Skip to content

feat(mfa): add recovery codes verify endpoint - #2764

Merged
fadymak merged 1 commit into
masterfrom
fm/auth-1533
Sep 2, 2026
Merged

fadymak merged 1 commit into
masterfrom
fm/auth-1533

Conversation

@fadymak

@fadymak fadymak commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Adds the POST /factors/recovery-codes/verify endpoint to redeem a recovery code for an AAL2 session.

  • Failures increment the per-user lockout
  • Invokes the MFA verification hook
  • Emits audit and metering events
POST /factors/recovery-codes/verify
Authorization: Bearer <aal1-access-token>

{ "code": "K4M9-X7QP-2AB8-HT3Z" }

The code is normalized (k4m9x7qp2ab8ht3z) and the caller's own session is upgraded to AAL2:

{
  "access_token": "…",
  "token_type": "bearer",
  "refresh_token": "…",
  "user": {}
}

@fadymak
fadymak requested a review from a team as a code owner August 31, 2026 13:40
Comment thread internal/api/recovery_codes.go Resolved

@annabkr annabkr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

left a couple questions but i trust you to make the right judgment call 🙏

Comment thread internal/api/recovery_codes.go Resolved
Comment thread internal/api/recovery_codes.go Resolved
@blacksmith-sh

This comment has been minimized.

Comment thread internal/api/recovery_codes.go Resolved
Base automatically changed from fm/auth-1532 to master September 2, 2026 14:43
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.

3 participants