forked from jappel/leistungsbilanz-ts
Add AUTH_DEV_AUTOLOGIN to switch off the login on development instances
With AUTH_DEV_AUTOLOGIN=<username>, every /api request without a valid session runs as that existing, active user and skips the forced password change. Unset keeps the normal login; unknown or deactivated users still get 401, real sessions take precedence, the CSRF application header stays mandatory and the API logs a warning at startup. The switch is not limited to localhost because the development instance is reached from other machines and through a reverse proxy (THREATMODEL D2/R15). It must never be set on an instance with real project data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4677b1685c
commit
084002bea9
11 changed files with 211 additions and 8 deletions
|
|
@ -69,6 +69,26 @@ Verknüpfung mit einer Mitarbeiter-/Personen-Stammdatentabelle.
|
|||
Klartext durchs Netz. Für Zugriff außerhalb des LANs HTTPS über einen
|
||||
Reverse-Proxy vorschalten und `COOKIE_SECURE=true` setzen.
|
||||
|
||||
## Entwicklungsinstanz ohne Login
|
||||
|
||||
`AUTH_DEV_AUTOLOGIN=<benutzername>` schaltet den Login für eine
|
||||
Entwicklungsinstanz ab (Entscheidung Julian, 2026-10-30): Jede `/api`-Anfrage
|
||||
ohne gültige Session läuft als dieser vorhandene, aktive Benutzer, auch der
|
||||
Passwortwechsel-Zwang entfällt. Der Schalter ist bewusst nicht auf localhost
|
||||
begrenzt, weil die Dev-Instanz von anderen Rechnern und über einen
|
||||
Reverse-Proxy erreicht wird. Jeder, der die Instanz erreicht, hat damit die
|
||||
Rechte dieses Benutzers. Leer (Standard) gilt der normale Login; ein
|
||||
unbekannter oder deaktivierter Benutzer führt weiter zu 401. Echte Sessions
|
||||
haben Vorrang, und die API protokolliert beim Start eine Warnung. Der
|
||||
CSRF-Anwendungsheader bleibt Pflicht. Auf einer Instanz mit echten
|
||||
Projektdaten darf der Schalter nie gesetzt sein.
|
||||
|
||||
```dotenv
|
||||
AUTH_BOOTSTRAP_USERNAME=julian
|
||||
AUTH_BOOTSTRAP_PASSWORT=<Startpasswort, mindestens 12 Zeichen>
|
||||
AUTH_DEV_AUTOLOGIN=julian
|
||||
```
|
||||
|
||||
## Bootstrap-Admin
|
||||
|
||||
`AUTH_BOOTSTRAP_USERNAME` / `AUTH_BOOTSTRAP_PASSWORT` (Env-Variablen, siehe
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue