Skip to content

Feature: TOTP two-factor authentication for all users #1507

Closed

Description

@larryro

Context

Compliance requires two-factor authentication for access over public networks. We currently have no MFA of any kind — no TOTP, WebAuthn, smart-card or client-cert support. This is the single biggest compliance gap.

Better Auth ships a twoFactor plugin that drops into our existing config at services/platform/convex/auth.ts.

Proposed change

  1. Enable Better Auth twoFactor plugin — TOTP + backup codes.
  2. Enrollment UI in Settings → Security: QR code, backup code download, recovery flow.
  3. Org-level enforceTwoFactor setting — owners/admins can require 2FA for all members.
  4. Sign-in flow: after password step, prompt for TOTP code (or backup code) before issuing a session.
  5. SSO users exempted (the IdP handles MFA).
  6. Audit log entries for: enrollment, successful 2FA, failed 2FA, reset-by-admin, backup code used.

WebAuthn / passkeys are valuable but larger — tracked as a follow-up issue.

Acceptance criteria

  • User can enroll TOTP with any standard authenticator app (Google Authenticator, 1Password, Authy).
  • Backup codes work as a second factor.
  • Admin can require 2FA org-wide.
  • Admin can reset a member's 2FA after identity verification.
  • E2E tests for enrollment, sign-in, backup-code usage.

Part of the security compliance baseline.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featpriority: highservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions