feat: 2fa backup codes#2
Conversation
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a308075bc3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onClick={(e) => { | ||
| e.preventDefault(); | ||
| resetState(); | ||
| onEnable(); |
There was a problem hiding this comment.
Call onEnable when backup-code dialog is dismissed
In the backup-code step, onEnable() is only invoked from the “Close” button handler. If the user dismisses the dialog via the overlay or Esc (Radix Dialog defaults), this handler never runs, so the parent does not invalidate viewer.me and the settings UI can stay in the “2FA disabled” state even though the enable endpoint already returned 200 and advanced to DisplayBackupCodes. That also lets users accidentally close the modal without saving the codes. Consider triggering onEnable/resetState from onOpenChange when step === DisplayBackupCodes or disabling outside-close for that step.
Useful? React with 👍 / 👎.
| <button | ||
| className="text-emphasis h-9" | ||
| tabIndex={-1} | ||
| type="button" | ||
| onClick={() => toggleIsPasswordVisible()}> |
There was a problem hiding this comment.
Keep password visibility toggle keyboard-accessible
Setting tabIndex={-1} on the password visibility toggle removes it from the tab order, which means keyboard-only users can no longer reach the control to show/hide the password. This is an accessibility regression from the previous behavior where the button was focusable. If there was a focus/UX issue you were addressing, consider alternative fixes (e.g., styling or focus management) that keep the button keyboard-accessible.
Useful? React with 👍 / 👎.
Test 3nn---nReplicated from ai-code-review-evaluation/cal.com-cursor#3