feat: 2fa backup codes#9
Open
akshayutture-augment wants to merge 1 commit into
Open
Conversation
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Author
|
cursor review |
| setPassword(""); | ||
| setErrorMessage(null); | ||
| setStep(SetupStep.ConfirmPassword); | ||
| }; |
There was a problem hiding this comment.
Bug: Memory Leak: Unrevoked Blob URLs
The resetState function doesn't revoke the blob URL stored in backupCodesUrl, causing a memory leak. When the modal closes or resets, the blob URL created on line 99 remains in memory. The cleanup should call URL.revokeObjectURL(backupCodesUrl) before resetting state, and ideally also in a cleanup effect when the component unmounts.
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.
Test 3
Replicated from ai-code-review-evaluation/cal.com-cursor#3
Note
Introduce 2FA backup codes with UI, API, auth, and DB changes to generate, use, and manage codes during login and 2FA enable/disable.
BackupCodeinput component and integrate into login and disable-2FA flows with a "lost access" toggle.TwoFactorcomponent with optionalautoFocusprop.PasswordFieldin relevant modals; minor accessibility tweak (toggle buttontabIndex=-1).POST /api/auth/two-factor/totp/setup: generate 10 encrypted backup codes; return them with QR/secret; persist to user.POST /api/auth/two-factor/totp/disable: acceptbackupCodeas alternative to TOTP; validate; clearbackupCodeson success; improved error handling.TwoFactorAuthAPI.disablenow sends{ password, code, backupCode }.backupCode; decrypts/validates; invalidates used code; expanded error codes.users.backupCodescolumn (encrypted JSON) via migration; update Prisma schema.Written by Cursor Bugbot for commit a308075. Configure here.