feat: password reset via email (#36) #49
Reference in New Issue
Block a user
Delete Branch "feat/36-password-reset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
POST /api/auth/forgot-passwordandPOST /api/auth/reset-password— both unauthenticated. Token stored in newpassword_reset_tokenstable (Flyway V8). Nightly cleanup via@Scheduled. If no SMTP is configured, logs a warning and silently skips sending./forgot-password(email form → success banner) and/reset-password?token=…(new-password form). "Passwort vergessen?" link added to the login page.MAIL_HOST/MAIL_PORT/MAIL_USERNAME/MAIL_PASSWORD/APP_MAIL_FROMenv vars — all optional with safe defaults.password-reset.spec.ts— 4 of 5 tests pass locally; the full reset flow test requires--spring.profiles.active=e2e(active in CI viaAuthE2EControllerhelper endpoint).Test plan
./mvnw test)npm run lint && npm run check)/forgot-passwordrenders without auth, shows success banner for any email/reset-password?token=invalidshows "Der Link ist ungültig oder abgelaufen."MAIL_HOSTunset: backend starts, no health failures, warning logged instead of email sent🤖 Generated with Claude Code
- Add PasswordResetToken entity, repository (Flyway V8 migration) - PasswordResetService: token generation, validation, nightly cleanup - AuthController: POST /api/auth/forgot-password and /api/auth/reset-password (both permitAll) - AuthE2EController (@Profile("e2e")): GET /api/auth/reset-token-for-test for CI testing - spring-boot-starter-mail dependency; JavaMailSender optional (@Autowired required=false) - mail health indicator disabled; mail config via MAIL_HOST/PORT/USERNAME/PASSWORD env vars - 5 unit tests written TDD-style (all pass) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>waitForURL('/') resolves as soon as the URL changes but before SvelteKit finishes hydrating — the avatar button's onclick is not yet registered, so the click has no effect and the dropdown never opens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>