feat(auth): Anmeldung mit Passwort und OIDC, Schutz aller Seiten (#013)

Signierte Sitzungs-Cookies mit jose, OIDC ueber openid-client (authentik),
Schutz in proxy.ts, Anmeldeseite, Audit-Log-Ansicht, Sicherheits-Kopfzeilen und
Rate-Limit. Kein Auth.js, weil Version 5 Beta ist. 147 Tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-17 22:40:03 +02:00
co-authored by Claude Opus 5
parent 6cc39591b7
commit ee487775ec
26 changed files with 945 additions and 27 deletions
+55
View File
@@ -0,0 +1,55 @@
"use client";
import { useActionState } from "react";
import { anmelden } from "@/server/actions/auth";
import type { AktionsErgebnis } from "@/server/actions/kunden";
const LEER: AktionsErgebnis = {};
export function AnmeldeFormular({ ziel }: { ziel: string }) {
const [ergebnis, aktion, laeuft] = useActionState(anmelden, LEER);
return (
<form action={aktion}>
<input type="hidden" name="ziel" value={ziel} />
{ergebnis.fehler ? (
<div className="alert alert-danger py-2" role="alert">
{ergebnis.fehler}
</div>
) : null}
<div className="mb-3">
<label className="form-label" htmlFor="email">
E-Mail-Adresse
</label>
<input
id="email"
name="email"
type="email"
className="form-control"
autoComplete="username"
required
/>
</div>
<div className="mb-3">
<label className="form-label" htmlFor="passwort">
Passwort
</label>
<input
id="passwort"
name="passwort"
type="password"
className="form-control"
autoComplete="current-password"
required
/>
</div>
<button type="submit" className="btn btn-primary w-100 pl-touch-target" disabled={laeuft}>
{laeuft ? "Meldet an …" : "Anmelden"}
</button>
</form>
);
}