chore(ops): harden deployment and runtime setup
This commit is contained in:
parent
1d7e7c41c9
commit
c35bd5877e
30 changed files with 534 additions and 61 deletions
|
|
@ -4,7 +4,7 @@ import Image from "next/image";
|
|||
import { useRouter } from "next/navigation";
|
||||
import { useState, type FormEvent } from "react";
|
||||
|
||||
export default function AdminLoginForm({ nextPath = "/admin" }: { nextPath?: string }) {
|
||||
export default function AdminLoginForm({ nextPath = "/admin", adminConfigured = true }: { nextPath?: string; adminConfigured?: boolean }) {
|
||||
const router = useRouter();
|
||||
const [error, setError] = useState("");
|
||||
const [pending, setPending] = useState(false);
|
||||
|
|
@ -34,6 +34,11 @@ export default function AdminLoginForm({ nextPath = "/admin" }: { nextPath?: str
|
|||
<form className="admin-login-card" onSubmit={submit}>
|
||||
<Image src="/funktechnik_schubert_logo.jpg" alt="Funktechnik Schubert" width={1672} height={941} priority />
|
||||
<h1>Administration Login</h1>
|
||||
{!adminConfigured && (
|
||||
<p className="error">
|
||||
Admin-Zugang ist nicht konfiguriert. Bitte ADMIN_EMAIL, ADMIN_PASSWORD und ADMIN_SESSION_SECRET in der Umgebung setzen.
|
||||
</p>
|
||||
)}
|
||||
<label>
|
||||
E-Mail
|
||||
<input name="email" type="email" autoComplete="username" required />
|
||||
|
|
@ -43,7 +48,7 @@ export default function AdminLoginForm({ nextPath = "/admin" }: { nextPath?: str
|
|||
<input name="password" type="password" autoComplete="current-password" required />
|
||||
</label>
|
||||
{error && <p className="error">{error}</p>}
|
||||
<button className="button" type="submit" disabled={pending}>{pending ? "Anmeldung..." : "Anmelden"}</button>
|
||||
<button className="button" type="submit" disabled={pending || !adminConfigured}>{pending ? "Anmeldung..." : "Anmelden"}</button>
|
||||
</form>
|
||||
</main>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue