29 lines
1.1 KiB
Markdown
29 lines
1.1 KiB
Markdown
## Auth Module
|
|
|
|
### Module Description
|
|
Handles user authentication, session management, and permission checks across the system.
|
|
|
|
### API Endpoints & Registration Flow
|
|
|
|
1. **POST /auth/login**
|
|
- Purpose: Benutzerlogin über Session/Cookie
|
|
- Auth: Keine
|
|
- Payload: `{"username_or_email": "string", "password": "string"}`
|
|
- Response: `{"user": {...}}`
|
|
|
|
2. **POST /auth/register/step1 ... /step3**
|
|
- Mehrstufige Registrierung (Rasse → Avatar/Titel → Username/Email/Passwort)
|
|
- Je Step wird der Draft gespeichert; Step3 erstellt Benutzer mit `activation_token` und nimmt `is_active=false` an, sofern `DEV_ENTWICKLUNG` nicht gesetzt ist.
|
|
- Response: `201` mit `{ "status": "pending" }` (E-Mail-Link) oder `{ "status": "active", "user": {...} }` (Dev-Bypass).
|
|
|
|
3. **POST /auth/register/confirm**
|
|
- Purpose: Aktivierung per Token-Link (`token` im Body oder Query)
|
|
- Auth: Keine
|
|
- Response: `{"user": {...}}` nach erfolgreicher Aktivierung.
|
|
|
|
4. **GET /auth/permissions**
|
|
- Purpose: Berechtigungen abrufen (Session erforderlich)
|
|
- Auth: Session
|
|
- Payload: Keine
|
|
- Response: `{"permissions": ["string"]}`
|