Add Better Auth admin authentication

This commit is contained in:
2026-06-04 12:05:07 +02:00
parent 0f10bd6400
commit e660ec24aa
41 changed files with 2225 additions and 284 deletions

View File

@@ -27,9 +27,17 @@ Copy `.env.example` to `.env.local` for local development. Keep real secrets out
- **OpenRouter:** `OPENROUTER_API_KEY`
- **SMTP / Stalwart:** `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASSWORD`, `SMTP_FROM`
- **Rybbit:** `RYBBIT_API_URL`, `RYBBIT_API_KEY`, `NEXT_PUBLIC_RYBBIT_SITE_ID`
- **Auth:** `BETTER_AUTH_SECRET`
Only variables prefixed with `NEXT_PUBLIC_` are intended for browser exposure. All API keys, SMTP credentials, and server-only URLs must stay server-side.
### Admin Auth Flow
- `/login` handles Anmeldung mit dem bestehenden Admin-Account. Registrierung ist nach der Ersteinrichtung serverseitig deaktiviert.
- Nach erfolgreicher Anmeldung wird auf `/dashboard` gewechselt.
- Die Session wird im Layout/Middleware geprüft (`/dashboard` bleibt geschützt), öffentliche Audit-Routen bleiben weiterhin frei.
- Für Passwortänderungen ist aktuell kein separater Endpunkt in der UI, daher für MVP bitte über administrativen Wartungsweg vorgehen.
## Routes
- `/` MVP entry page.