Skip to content

feat(mosaic): verify the sign-up email by link - #11049

Draft
austincalvelage wants to merge 11 commits into
austin/mosaic-sign-up-enterprise-ssofrom
austin/mosaic-sign-up-email-link
Draft

austincalvelage wants to merge 11 commits into
austin/mosaic-sign-up-enterprise-ssofrom
austin/mosaic-sign-up-email-link

Conversation

@austincalvelage

@austincalvelage austincalvelage commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Description

Verifies the sign-up email by link in Mosaic <SignUp />. Stacked on #11022.

An instance that lists email_link on the email address used to end on Start over. Sign-up now sends the link, waits for it, and handles the page the link opens. The link wins whenever the instance enables it, also when the code is enabled too, as the legacy SignUpVerifyEmail picks it.

Shared changes (for Mosaic reviewers)

  • The test fake for sign-up accepts email_link in prepare_verification, records its redirect URL, and can open or expire the link the way FAPI does.

1. The link screen sends a link each time it opens, and waits. As in legacy's SignUpEmailLinkCard, opening the screen always sends a fresh link and starts a fresh wait, so a reload sends another one. A send FAPI refuses, such as its rate limit, shows its error, with Resend and Edit usable after the cooldown. Resend is locked for 60 seconds. Edit goes back to the form with the email kept and the password cleared, and stops the wait. If finishing fails after the link is opened elsewhere, the error shows on the screen and Edit and Resend stay usable, as in legacy.

2. The wait ends by who opened the link.

The link was opened This tab
On another device or browser carries on by step, and signs in when the sign-up is complete
In this browser says to continue in the other tab, which is the one that gets signed in
Too late shows that the link expired, with Resend still available

3. The page the link opens is marked in the URL, like the OAuth return. Routing is in memory, so the link comes back to the same page with __clerk_mosaic_sign_up=verify. Sign-up reads __clerk_status once and removes the parameters.

__clerk_status Sign-up
verified, with a session this client has activates it and leaves for the after sign-up URL, or shows the failed status if activating fails, as legacy's EmailLinkVerify does
verified, with a session on another client "Successfully signed up", return to the original tab
verified, with no session yet carries on by step in this tab, or says to return to the other tab when this browser holds no sign-up
expired, client_mismatch, transferable, failed the status screen for it

The link's return URL keeps only Mosaic's marker out of Clerk's own __clerk_* params, as legacy builds it from the redirect params only. FAPI appends __clerk_status rather than replacing it, so a leftover one (for example after a failed invitation) made a verified link read as invalid. The OAuth and enterprise returns share this URL, so an invitation's __clerk_ticket no longer comes back after them, also as in legacy.

Differences from legacy that stay

  • Leaving the link screen stops the wait. Legacy keeps polling.
  • With fields still missing, the link tab goes straight to them. Legacy shows "return to the other tab" for about 1.5 seconds first.
  • The status screens have no icon. That comes from the shared status block.

Known gaps

  • React <Activity> hide and show can leave the link screen waiting forever: hiding cancels the wait and showing does not start a new one.

  • The marker moves to the router's return URL when feat(mosaic): Add links and return URLs that reopen a component's page in every routing mode #10860 lands, with the OAuth return's.

  • Poller.stop() in @clerk/shared does not clear a timer whose id is 0, which the worker timers hand out first, so a stopped wait polled again. The model's cancel sets a flag the next tick checks. The fix in poller.ts belongs in its own PR, after which the flag can go.

  • client_mismatch and transferable are tested as URL statuses. The test fake does not produce them.

  • A reload on the link screen returns to the first form, because routing is virtual.

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 Nov 30, 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 2, 2026 5:57pm UTC
mosaic-docs Ready Ready Preview Dec 2, 2026 5:57pm UTC
swingset Ready Ready Preview Dec 2, 2026 5:57pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 30, 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

@changeset-bot

changeset-bot Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7f4d2c9

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

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-native-components

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: e7288a1

This branch was successfully deployed

2 active deployments
Preview – swingset — 7f4d2c92 Deployed Dec 2, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 7f4d2c92 Deployed Dec 2, 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