Skip to content

Enforce MFA backup codes shown-once with rotation endpoint#118

Merged
Senthil455 merged 2 commits into
mainfrom
fix/issue-45-mfa-backup-codes
Jun 17, 2026
Merged

Enforce MFA backup codes shown-once with rotation endpoint#118
Senthil455 merged 2 commits into
mainfrom
fix/issue-45-mfa-backup-codes

Conversation

@Senthil455

Copy link
Copy Markdown
Owner

Add backup_codes_shown column to user_mfa table so backup codes are only returned on the initial setup request. Add /mfa/rotate-backup-codes endpoint that requires current TOTP token to generate and display new backup codes.

Add backup_codes_shown flag to user_mfa table. Backup codes are only
returned on the initial setup request and marked as shown afterwards.
Re-running setup will regenerate codes but not display them. Add a
/mfa/rotate-backup-codes endpoint that requires current TOTP token
to view new backup codes.

@Senthil455 Senthil455 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds shown-once enforcement for MFA backup codes and a rotation endpoint with TOTP re-authentication. The backup_codes_shown flag prevents codes from being returned more than once.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant