Skip to content

Add 2FA support for admin accounts #557

Description

@Wilfred007

What

@otplib/preset-default and qrcode are installed. Implement TOTP-based 2FA for admin login to protect privileged accounts.

Why

Admin accounts have elevated privileges (payroll execution, employee management, org settings). 2FA is essential.

Scope

In scope: Generate TOTP secret, QR code, verify on login, recovery codes
Out of scope: SMS 2FA, hardware keys

Acceptance Criteria

  • Admin can enable 2FA from settings
  • QR code generated for authenticator app
  • Login requires TOTP code when 2FA enabled
  • 8 recovery codes generated
  • 2FA can be disabled with current TOTP code

Technical Context

  • backend/src/services/authService.ts — auth service
  • @otplib/preset-default — TOTP library
  • qrcode — QR generation

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignbackendBackend developmenthardComplex taskssecurityIssues related to application security and audits

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions