fix(ui): avoid repreparing pending code verifications#8548
Conversation
🦋 Changeset detectedLatest commit: c02fabb The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis 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. Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
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