Repository navigation
fix(2fa): inject recovery handlers and lock out invalid codes - #966
Merged
thlpkee20-wq merged 1 commit intoOct 22, 2026
Conversation
|
@Micheal1605 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes the 2FA account recovery flow so it fails closed: verification is delegated to an injectable async handler, invalid codes surface an inline error and stay on the verify step, and repeated failures lock the input with a cooldown. The recovery page now supplies a clearly labelled demo implementation.
Related Issue
Changes
🔐 Recovery Flow Handlers
[MODIFY]
src/components/TwoFactorRecoveryFlow.tsxonRequestCode(email),onVerify(code) => Promise<boolean>, andonResend(email).handleVerifynow awaitsonVerifyand only advances to the success step when it resolvestrue;falseor a thrown/rejected promise shows an inline, retryable error and keeps the user on the verify step.[MODIFY]
src/pages/TwoFactorRecoveryPage.tsxonRequestCode,onVerify, andonResendso/recover-2faremains usable while a real backend is wired up.✅ Tests
src/components/TwoFactorRecoveryFlow.test.tsxonVerifyresolvesfalse) shows an error and stays on the verify step.onVerifyshows a retryable error and does not advance.Verification Results
onVerifyresolvingfalserenders inline error, step unchangedonVerifyresolvingtruemoves to success steponVerifysurfaces error without advancingmaster, passes after fixCloses #930