You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 15f26c5
Browse filesBrowse the repository at this point in the historyBrowse files
Add TOTP two-factor, recovery codes, and session management
Two-factor (Google Authenticator-compatible):
- Hand-rolled RFC 6238 TOTP (SHA-1, 30s, 6 digits) on node:crypto, verified
against the RFC test vectors (9 unit tests). No third-party auth dependency.
- Setup flow stores a pending secret, returns an otpauth URI + QR data URL, and
only enables 2FA after the user proves a valid code.
- Ten one-time recovery codes (SHA-256 hashed) issued on enable; regenerate and
disable both require the password. Login accepts a TOTP code or a recovery code.
Sessions:
- Sessions now record login IP, user-agent and a throttled rolling last-seen.
- GET /auth/sessions lists active sessions (current one flagged); DELETE one or
all-others to revoke. Surfaced on a new Account page.
Web:
- Login gains a second step for the 2FA code; Account page for 2FA setup (QR +
recovery codes) and session review/revocation. De-emojified prominent headers.
Tests: 2 integration tests (2FA required + recovery-code consumption; session
list + revoke). Suite now 27 API tests. Checklist updated.
0 commit comments