Skip to content

feat(mosaic): enable URL routing for sign-up - #11128

Draft
austincalvelage wants to merge 9 commits into
mainfrom
austin/mosaic-sign-up-url-routing
Draft

austincalvelage wants to merge 9 commits into
mainfrom
austin/mosaic-sign-up-url-routing

Conversation

@austincalvelage

Copy link
Copy Markdown
Member

Description

Lets Mosaic SignUp live in the URL, and sends its OAuth and email-link returns to the same routes @clerk/ui's SignUp uses. Based on main. The next PR in the stack makes path and hash routing read the hash URLs legacy builds.

Shared changes (for Mosaic reviewers)

1. routing and path put sign-up's screens in the URL. SignUp takes the routing props every Mosaic component takes and renders under its own routing scope, so a reload, Back and Forward land on the screen in the URL, and a route the sign-up doesn't allow is replaced by the one it does. Virtual stays the default.

export function SignUp({ routing: requested = 'virtual', path = '/sign-up', ...props }: SignUpProps) {
  const routing = useFixedRoutingMode(requested);
  const router = useRouterScope(signUpRoutes, { routing, path, root: 'start' });
  return (
    <MosaicRoutingScope scope={router.scope}>
      <SignUpContent {...props} routing={routing} router={router} />
    </MosaicRoutingScope>
  );
}

2. OAuth and email-link returns land on sso-callback and verify, as in ui. The __clerk_mosaic_sign_up marker is gone. Sign-up's route table gains legacy's two return routes, and opening sign-up on one of them runs the return behind the loading screen.

if (route === 'verify') {
  return 'emailLink';
}
if (route === 'ssoCallback' && override.type !== 'leave') {
  return 'return';
}

The URLs match ui's buildRedirectUrl (ui/src/common/redirects.ts), with the redirect query built by RedirectUrls(...).toSearchParams() as ui's authQueryString is:

Routing OAuth callback Email link
path /sign-up/sso-callback?redirect_url=… /sign-up/verify?redirect_url=…
virtual <signUpUrl>#/sso-callback?redirect_url=… <signUpUrl>#/verify?redirect_url=…
hash /app?redirect_url=…#.sign-up=sso-callback /app?redirect_url=…#.sign-up=verify
query /app?redirect_url=…&.sign-up=sso-callback /app?redirect_url=…&.sign-up=verify

In virtual mode the return goes to the sign-up URL, as in ui, so a sign-up that started in a modal or an embedded component finishes on the sign-up page. That page completes it when it routes by path or hash (next PR) or is Account Portal.

3. A sign-up that is already complete or transferable finishes when sign-up opens. With no session override, the arrival intent is finish: the loading screen shows from the first paint, complete runs finalize(), and transfer transfers the account as the OAuth return does. This covers opening sign-up off sso-callback after the return began.

Known gaps

  • Mosaic's hash and query modes write the route in Mosaic's own form (#.sign-up=sso-callback), not ui's #/sso-callback, and keep the redirect params in the page query.
  • In path mode the return URL drops the page's __clerk_* params, which ui keeps, so a stale ticket or link status does not come back.
  • The email link's status shows on the route sign-up lands on, not on /verify as in ui, so Back in the same mount does not run the return again.
  • SignUp has no ssoCallbackUrl, emailLinkRedirectUrl, forceRedirectUrl, fallbackRedirectUrl or signInUrl props yet, and no /create prefix for a combined flow.

The changeset is empty because SignUp is not exported yet.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

🤖 Generated with Claude Code

@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Dec 4, 2026 11:34pm UTC
mosaic-docs Ready Ready Preview Dec 4, 2026 11:34pm UTC
swingset Ready Ready Preview Dec 4, 2026 11:34pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b7a880c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@pkg-pr-new

pkg-pr-new Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@11128

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@11128

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@11128

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@11128

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@11128

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@11128

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@11128

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@11128

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@11128

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@11128

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@11128

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@11128

@clerk/express

npm i https://pkg.pr.new/@clerk/express@11128

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@11128

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@11128

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@11128

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@11128

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@11128

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@11128

@clerk/react

npm i https://pkg.pr.new/@clerk/react@11128

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@11128

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@11128

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@11128

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@11128

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@11128

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@11128

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@11128

commit: b7a880c

…k and verify routes

Sign-up now builds its OAuth/SAML callback URL and its email link's
redirect URL the way @clerk/ui's SignUp context does: the sso-callback or
verify route plus ui's redirect query string. Path routing returns to
<path>/sso-callback and <path>/verify, virtual routing to
signUpUrl#/sso-callback and signUpUrl#/verify, and hash and query routing
to the same routes on the current page in Mosaic's own format. Arriving on
either route runs the return, which replaces the __clerk_mosaic_sign_up
marker.
@austincalvelage
austincalvelage force-pushed the austin/mosaic-sign-up-url-routing branch from 60129ec to b7a880c Compare December 4, 2026 23:31
@austincalvelage austincalvelage changed the title feat(mosaic): route sign-up in the URL and return to ui's sso-callback and verify routes feat(mosaic): enable path routing for sign-up Dec 5, 2026
@austincalvelage austincalvelage changed the title feat(mosaic): enable path routing for sign-up feat(mosaic): enable URL routing for sign-up Dec 5, 2026

This branch was successfully deployed

2 active deployments
Preview – swingset — b7a880ca Deployed Dec 4, 2026 by vercel[bot]
Preview – clerk-js-sandbox — b7a880ca Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant