-
Notifications
You must be signed in to change notification settings - Fork 436
fix(ui): prevent infinite spinner on factor-two without active 2FA session #7774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: aecc1b5 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 |
📝 WalkthroughWalkthroughAdds a patch changelog entry noting a fix for an infinite loading spinner on the factor-two sign-in route. Updates SignInFactorTwo to import runtime Clerk hooks and a router, and adds a useEffect that redirects to the sign-in start path when mounted if signIn.status is null, 'needs_identifier', or 'needs_first_factor', unless an active in-progress operation exists; it skips redirect when status is 'complete'. commitlint's subject-case rule was relaxed from error to warning. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
…ssion Why: Users navigating directly to /sign-in#/factor-two without an active sign-in requiring 2FA would see an infinite loading spinner because there was no status check to redirect them back to sign-in start. What changed: Added useEffect to SignInFactorTwo that redirects to sign-in start when signIn.status is null, needs_identifier, or needs_first_factor. Matches the existing pattern in SignInFactorOne. Key detail: dependency array only includes __internal_setActiveInProgress (not signIn.status) to avoid triggering redirect during valid sign-in completion when status changes to null.
5b2e2e4 to
6b510af
Compare
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@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: |
Acronyms like 2FA, SSO, JWT in commit subjects trigger false positives with the strict case check.
fa494da to
aecc1b5
Compare
Summary
Users navigating directly to
/sign-in#/factor-twowithout an active sign-in requiring 2FA would see an infinite loading spinner. This adds a status check to redirect them back to sign-in start, matching the existing pattern inSignInFactorOne.useEffecttoSignInFactorTwothat redirects whensignIn.statusisnull,needs_identifier, orneeds_first_factor__internal_setActiveInProgress(notsignIn.status) to avoid flash during valid sign-in completionWhy not
signIn.status !== 'needs_second_factor'?That condition catches
completestatus, causing a flash to the sign-in page before the final redirect. By explicitly checking for invalid statuses only, we avoid interfering with the normal sign-in completion flow.Test plan
/sign-in#/factor-twowithout active sign-in → redirects to sign-in start🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Chores