27 lines
954 B
Plaintext
27 lines
954 B
Plaintext
Implementa AUTH completo (server-rendered) e templates in /web/templates/public.
|
|
|
|
Routes:
|
|
- GET/POST /signup
|
|
- GET/POST /login
|
|
- POST /logout
|
|
- GET /verify-email?token=...
|
|
- GET/POST /forgot-password
|
|
- GET/POST /reset-password?token=...
|
|
|
|
Comportamento:
|
|
- Signup crea user (role=user, verified=false), genera verify token (hash in DB), invia email (mailer).
|
|
- Login: blocca se email non verificata.
|
|
- Verify-email: valida token, set EmailVerified=true, elimina token.
|
|
- Forgot-password: risposta sempre generica; se user esiste+verified, genera reset token e invia email.
|
|
- Reset-password: valida token, aggiorna password, elimina token.
|
|
|
|
Crea templates:
|
|
- public/login.html
|
|
- public/signup.html
|
|
- public/forgot_password.html
|
|
- public/reset_password.html
|
|
- public/verify_notice.html
|
|
- public/home.html (opzionale)
|
|
Aggiungi partial per flash (public/_flash.html) e includilo nel layout.
|
|
|
|
Usa repo/service per accesso DB e logica (non tutto nel controller). |