Fix login: redirect to verify-email if user is not verified
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled

- After login, check if user.is_verified is false
- If not verified, redirect to /verify-email page instead of dashboard
- This ensures same UX as after registration
This commit is contained in:
2025-12-09 21:29:11 +01:00
parent d815c0780f
commit 3f456658ee

View File

@ -79,6 +79,15 @@ function LoginForm() {
try { try {
await login(email, password) await login(email, password)
// Check if email is verified
const user = await api.getMe()
if (!user.is_verified) {
// Redirect to verify-email page if not verified
router.push(`/verify-email?email=${encodeURIComponent(email)}`)
return
}
// Redirect to intended destination or dashboard // Redirect to intended destination or dashboard
router.push(redirectTo) router.push(redirectTo)
} catch (err: unknown) { } catch (err: unknown) {