feat(ui): add multiSessionStart prop to SignIn (render in place) - #9704
feat(ui): add multiSessionStart prop to SignIn (render in place)#9704djgould wants to merge 1 commit into
Conversation
Renders the account switcher on the sign-in start screen for signed-in visitors on multi-session instances when `multiSessionStart="switcher"`. "Add account" navigates within the router with `__clerk_add_account`, which the start screen honors and the router preserves across internal navigation and the OAuth/email-link callback. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 023b8a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (16)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: 9 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour. 📝 WalkthroughWalkthroughAdds the Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to This adds an opt-in account-switcher entry for multi-session sign-in while preserving the default form flow and carrying add-account navigation through supported paths. No concrete merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 15 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Warning Linked repositories: Your configuration references 7 linked repositories, but your current plan allows 5. Analyzed Comment |
Description
Alternative to #9651 (and #9683) that renders the switcher in place instead of redirecting to it. Same feature, no router
replaceoption needed.Adds a
multiSessionStartprop to<SignIn />. WithmultiSessionStart="switcher", a signed-in user on a multi-session instance sees the account switcher on the sign-in start screen instead of the sign-in form. The default"form"keeps today's behavior. The prop is ignored in single-session mode.Why. FAPI sends OAuth consent requests through
signInUrl?redirect_url=…and expects the sign-in UI to forward users who are already signed in. That only happens in single-session mode. On multi-session instances (for exampleclerk auth loginagainst the dashboard) a signed-in user has to sign in again.How it works
<SignInAccountSwitcher />when the prop is set, sessions exist, and__clerk_add_accountis not in the URL. No redirect, no history entry, so Back goes to the previous page. Thechooseroute still exists for deep links and for clerk-js after a single sign-out.__clerk_add_account=true. The start screen shows the form when it is set. The router keeps it across internal navigation and the OAuth / email-link callback, so a failed attempt comes back to the form with its error. This also works inside a modal.<UserButton />and the Mosaic user button adds the same flag to the sign-in URL, so they land on the form instead of the switcher.redirect_url.#?x, which the router does not read as a fragment URL. It now produces#/?x.Compared to #9651: no
replaceplumbing (drops #9683 as a dependency), the switcher's "Add account" is an in-app navigation instead of a full page load, and the modal shows the form instead of leaving the page. Cost: the switcher takes anaddAccountPathprop because it is mounted both in place (.) and on thechooseroute (..).Prior art: #9583.
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code