Repository navigation
feat(mosaic): run the Protect check in sign-up - #10928
Draft
austincalvelage wants to merge 21 commits into
Draft
austincalvelage wants to merge 21 commits into
austincalvelage wants to merge 21 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7de6146 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen 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 |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
1 of 9 tasks
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 20, 2026 17:26
9cb2169 to
16606fa
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 20, 2026 19:21
16606fa to
1988f58
Compare
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 20, 2026 20:17
1988f58 to
8e9ac1a
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 20, 2026 20:41
8e9ac1a to
67abc3f
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 20, 2026 20:50
67abc3f to
98acc77
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 20, 2026 21:29
98acc77 to
cfa7a9f
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 23, 2026 22:27
4ab636b to
3fe70e5
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 23, 2026 23:20
3fe70e5 to
ff3aa9b
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-protect
branch
from
November 24, 2026 01:14
ff3aa9b to
3bc5be5
Compare
When Clerk returns a Protect challenge, sign-up shows its protect screen, runs the challenge script in it, submits the proof and moves to the next step. A failed challenge shows the error with Try again, and a second challenge remounts the screen to run it. The fake FAPI can issue challenges and serves a challenge script for the feature tests.
… tests Two Protect tests ended on the verify screen without waiting for the code send, so a late send could write their sign-up into Clerk's shared signals during the next test, which then failed to find the challenge on CI.
- Resolve the challenge with `runProtectCheck`, so an already-resolved proof reloads and continues, and an expired challenge reloads under the shared cap. The controller keeps the reload count, since the screen remounts for each reissued challenge. - Route a challenge raised on the continue screen to `continue/protect-check`, so the next verify step and Edit stay under continue. - Show the blocked notice when the proof is blocked. - Clear the container and the widget visibility before each run, so Try again starts from an empty container with the spinner.
The fake FAPI let the Protect tests pass on recoveries the real backend never offers. It now follows clerk_go 8bb8f66dde: - A proof for a check that is no longer pending is a 404 resource_not_found carrying the client (api/shared/sign_up/service.go:2746-2748, api/fapi/v1/wrapper/wrapper.go:49). protect_check_already_resolved is sign-in only. - A GET reload only serializes the sign-up (api/fapi/v1/sign_up/http.go:173-195), so the reissue-on-reload seed is gone. - A rejected proof returns 200 with a replacement challenge (api/shared/sign_up/service.go:2774-2809), not protect_check_invalid. - An update keeps a pending, unexpired check unchanged (api/shared/sign_up/service.go:2508-2514). The resolved-elsewhere test now expects the sign-up from the 404 to carry the user on to email verification. The expired test also checks that Try again is offered instead of a stuck spinner. A new test runs the replacement challenge after a rejected proof.
SignUpFuture has no reload, so the shared runner reloads the classic sign-up the future wraps. FAPI's GET reload never reissues an expired check, so the reload only confirms the expiry.
The route table test already pins where protect and verify sit under continue. The feature test keeps the screens and where Edit lands.
…load count in the flow controller
…through the fake FAPI
…ontroller The model holds no React state, so the count that outlives each challenge's remount moves to the flow controller, as the flow guide already says. The Protect screen passes it to resolve and resets it on Try again.
…test and drop the fake's comments
A Protect check can be the last requirement, so resolving it returns `complete` and the flow activates the new session from the Protect screen. The tests hold and fail that activation. Two fail: the screen shows no spinner while the activation runs, and a failed activation shows no error and no way to run it again.
When resolving the Protect check completes the sign-up, the flow activates the new session while the Protect screen stays up. The flow controller gave that screen no finish state, so it showed its title with no spinner, and a failed activation showed no error and no way forward. The Protect screen now receives the flow's pending state and finish error, as the verify screens do. After a failed activation, Try again runs the activation again. No challenge is left at that point, so the model's `resolve` returns `complete` without running one.
The tests render SignUp and follow the check from the start form through the code screen, the continue screen and the session activation, so the file sits in sign-up/__tests__ with the other sign-up feature tests. They are grouped by what the user is doing, and the two tests that asserted sign-up left once now wait for the card to empty instead of two event-loop turns.
…w hold The routing branch replaced isFinishing with the hold outcome.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Runs the Clerk Protect check in Mosaic sign-up. Stacked on #10881.
When an instance has "Challenge suspicious sign-ups" on and Clerk flags a sign-up,
signUp.create()comes back with a challenge. Sign-up moves to theprotect-checkroute, runs the challenge, submits the proof and goes on to the next step, usually the code screen. A challenge raised from the continue screen goes tocontinue/protect-checkinstead.SignUpFuturehas noreload, so the runner reloads the classic sign-up the future wraps. No clerk-js change is needed.Review fixes
runProtectCheckwith the classic sign-up'sreload(), the runneruiuses throughuseProtectCheckRunner.fix(mosaic): reload the classic sign-up in the Protect runnerswitches that reload to the classic sign-up, sinceSignUpFuturehas noreload.fix(mosaic): run the sign-up Protect check through the shared runner, covered by "continues with the sign-up the 404 returns when the Protect check was resolved elsewhere" and "shows the timeout when a reload returns the Protect check expired, and reloads again on each Try again".fix(mosaic): run the sign-up Protect check through the shared runner, covered by "keeps the continue screen as the place to edit after a Protect check raised on it".fix(mosaic): run the sign-up Protect check through the shared runner, covered by "replaces the Protect check with the blocked notice when the proof is blocked".fix(mosaic): run the sign-up Protect check through the shared runner, covered by "clears the failed widget before Try again runs the Protect check again" and "shows the loading spinner on Try again when the failed widget left itself shown".test(mosaic): match the fake sign-up Protect check to clerk_go, covered by "runs the replacement Protect check Clerk issues for a rejected proof" and the two tests above./sign-upredirect and the legacysignUpUrlchange are out of this PR, since they aren't part of Protect.1. The model gets a
protectgroup. It runs the challenge withrunProtectCheckfrom@clerk/shared, which submits the proof and reloads an expired check under the shared cap. Then it returns the next step. When the check was already resolved elsewhere, FAPI answers the proof with a 404 that carries the client, and sign-up moves on to the step that sign-up reports.2. The screen runs the challenge when it mounts. A submit, a reload and a second challenge all arrive the same way. It takes the challenge token as its
key, so when Clerk issues another challenge the screen remounts and runs it. The flow controller keeps the expired-reload count, so the cap holds across those remounts.3. The card shows a spinner until the challenge asks to show something. The script calls
setWidgetVisible(true)before it draws in the card, the same handshake legacy uses. A failed challenge shows the error with Try again. Try again empties the container and hides the widget before it runs again, so the spinner comes back. A check that completes the sign-up keeps the screen busy while the session activates. If activation fails, the screen shows the error and Try again runs the activation again.4. A challenge from continue stays under continue.
continueProtectCheckiscontinue/protect-check, so the next code screen and its Edit link go back to continue, not start. A blocked proof shows the blocked notice on either Protect route. The proof returns the blocked result the same waycreatedoes in #10881.Try again resets the expired-reload count, covered by "shows the timeout when a reload returns the Protect check expired, and reloads again on each Try again". The screen takes the
protectgroup whole.Changes outside sign-up
SignUpViewPropstakeslogo?: { src, alt }in place ofapplicationLogoUrl, built once and shared with the Protect screen.protectCheckis now a slot (ReactNode) the wrapper fills withSignUpProtect.resource_not_foundwith the client, a GET reload only returns the sign-up, a rejected proof returns 200 with a replacement challenge, and an update keeps a pending, unexpired check.Known gaps
signUp.create()whenever the legacy UI is loaded, so this screen only runs when it isn't. The flow doc says a Mosaic host must not load the legacy UI (prefetchUI={false}on the provider).Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code