fix(ui): Prevent infinite loading spinner on factor-two without active 2FA#7751
fix(ui): Prevent infinite loading spinner on factor-two without active 2FA#7751alexcarpenter wants to merge 2 commits intomainfrom
Conversation
…e 2FA session When users land on the factor-two sign-in route without an active 2FA session (e.g., via a force redirect URL), they would get stuck on an infinite loading spinner. This fix adds a status check to redirect users back to the sign-in start page if the sign-in status is not 'needs_second_factor', matching the pattern already implemented in SignInFactorOne. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 9942e36 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 |
📝 WalkthroughWalkthroughThis change fixes an infinite loading spinner issue in the SignInFactorTwo component. The fix adds a redirect mechanism that navigates users back to the sign-in start route when they access the factor-two sign-in page without an active second-factor authentication session. A React effect monitors the sign-in status and router to trigger the redirect when the status is not 'needs_second_factor'. A changeset entry documents this patch release, and a new test replaces a placeholder to verify the navigation behavior occurs as expected. 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@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: |
| if (signIn.status !== 'needs_second_factor') { | ||
| void router.navigate('../'); | ||
| } |
There was a problem hiding this comment.
Could we detect if the user is signed in and redirect to any present redirect url in that case? 🤔
|
closing in favor of #7774 |
Description
Fixes an issue where users landing on the factor-two sign-in route without an active 2FA session would see an infinite loading spinner. This can occur when navigating directly to the URL with a force redirect parameter. The fix adds a status check to redirect users back to the sign-in start page if the sign-in status is not 'needs_second_factor', matching the existing pattern in SignInFactorOne.
Test Plan
Type of change
Summary by CodeRabbit
Bug Fixes