Users can optionally add a password to their account (after signing in once by magic link) and then sign in with email + password. Magic link login stays available for everyone.
Login is magic-link only: every sign-in needs an email round-trip (Gmail SMTP, 200 emails/day shared with notification digests). Users on a new device must switch to their mailbox; when the budget is exhausted nobody can log in.
POST /user/login {email, password}: success → JWT (or MFA_REQUIRED); any failure → 401 INVALID_CREDENTIALS
Must
FR-2
Header login form keeps the magic-link email field; a "Đăng nhập bằng mật khẩu" button opens a modal (email pre-filled + password with show/hide toggle)
Must
FR-3
PUT /user/password set (no current) / change (current required); OTP required when MFA enabled
Must
FR-4
DELETE /user/password (current required)
Should
FR-5
Policy: 10–72 bytes, not containing email local part, not in common-password list; clear Vietnamese error messages
Must
FR-6
Lockout: 5 consecutive failures → 15 min; counter reset on success; magic link unaffected
Must
FR-7
Password set/change/remove revokes other sessions (current session receives a new JWT)
Must
FR-8
Security email on set/change/remove
Should
FR-9
passwordEnabled per user in /user/me and settings; Settings shows Set / Change / Remove accordingly
Must
FR-10
/user/join no longer auto-registers with a password (legacy path removed)
Must
FR-11
Kill switch app.auth.password-login-enabled hides the tab and disables password endpoints