You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the sign-in or sign-up flow rehydrates a session that already has a pending email/phone code verification, the code-entry components were calling prepare* on mount and sending the user a second OTP. This skips the initial prepare in that case while leaving the explicit "Resend code" path untouched, so users only get a new code when they ask for one.
This PR adds deduplication logic across SignIn and SignUp verification flows to prevent re-preparing verification codes when a matching pending (unverified) verification already exists. SignInFactorOneCodeForm now detects when a pending first-factor phone code verification is present and skips automatic preparation. SignUpEmailCodeCard and SignUpPhoneCodeCard similarly detect pending email or phone code verifications and skip re-preparation in those cases. Tests validate the new behavior for both pending and expired verification states.
The description clearly explains the problem (duplicate OTPs on mount/refresh) and solution (skip initial prepare for pending verifications while preserving explicit Resend behavior).
Linked Issues check
✅ Passed
The PR comprehensively addresses issue #8463 by implementing the suggested fix: detecting pending verifications on mount and skipping prepare calls for SignIn/SignUp code-entry components.
Out of Scope Changes check
✅ Passed
All changes are directly scoped to fixing the pending OTP reprepare regression: component state logic, tests, and integration tests validating the fix without unrelated modifications.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check
✅ Passed
The PR title accurately summarizes the main objective: preventing duplicate OTP preparation when code verifications are already pending, which is the core fix across all modified components.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
Warning
Review ran into problems
🔥 Problems
Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.
Comment @coderabbitai help to get the list of available commands and usage tips.
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
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.
When the sign-in or sign-up flow rehydrates a session that already has a pending email/phone code verification, the code-entry components were calling
prepare*on mount and sending the user a second OTP. This skips the initial prepare in that case while leaving the explicit "Resend code" path untouched, so users only get a new code when they ask for one.Closes: #8463