Skip to content

Implement TOTP two-factor with trusted-device and recovery codes (per docs/MFA_ROADMAP) #1291

Description

@nanaf6203-bit

Context

docs/MFA_ROADMAP.md details TOTP rollout; schema has UserPreferences.twoFactorEnabled and secret fields (migration 20260324084550); auth.service already handles CAPTCHA gating.

Problem

The roadmap exists but none of it is shipped. A real-estate transaction platform without 2FA leaves admin/agent sessions and password resets as single-factor - a primary account-takeover vector given the financial nature of listings/transactions in this codebase.

Proposed approach

Deliver TOTP (e.g. otplib/speakeasy): enroll (QR via qrcode), verify enablement, challenge during login when enabled, session trust marker (skip re-challenge), recovery codes, and admin ability to force-disable on request. Refuse high-risk ops without fresh 2FA.

Acceptance criteria

  • Enroll/challenge/recover works in e2e; never disables itself into a locked account.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions