Repository navigation
feat(mosaic): wire up sign-up with step routing - #10881
Draft
austincalvelage wants to merge 45 commits into
Draft
austincalvelage wants to merge 45 commits into
austincalvelage wants to merge 45 commits into
Conversation
getSignInNextStep and getSignUpNextStep now return SignInNextStep and SignUpNextStep, so a sign-up caller can switch over its steps exhaustively without handling sign-in steps it never receives. NextStep stays as their union.
…sing fields getSignUpNextStep followed navigateToNextStepSignUp's order, which only the OAuth return and sign-up-if-missing paths use. It now follows completeSignUpFlow, the order the sign-up forms use.
signUpRoutes keeps legacy's segments. routeFor maps each sign-up step to its route, and allowedRoute decides whether the current route may stay, as the sign-in and sign-up flow guide describes.
…ngSignup It now takes the fields it reads instead of the legacy SignUpResource, so Mosaic can pass the SignUpFuture resource.
useSignUpModel reads the sign-up through the shared signal hook and the environment, and exposes the next step, the start and continue fields from legacy's rules, and callbacks that return the next step.
SignInStartOver becomes AuthStartOver, which takes its copy as messages like the other shared auth screens, so sign-up can show it too.
The view renders AuthStartOver for a sign-up step it cannot continue, with a Swingset story beside the other flow notices.
FAPI names the sign-up field email_address, so save routes its errors to the field without a mapping. Sign-in keeps identifier for its first screen; its Swingset story copies the email into emailAddress when the combined flow moves to the sign-up details.
It picks the screen from the route and the sign-up step, builds the view's step, submits the start and continue forms and verification codes, and moves on with the step each call returns. Sending codes comes next.
A small machine sends the code when the flow moves to a verify screen and the step says none is out yet, and locks resend for 30 seconds.
SignUp composes the sign-up model, controller and view with virtual routing. It is exported from the sign-up feature only, not from the package entry.
… on Continue finalize ran as a second action inside the code action's lock, so it was dropped and the session never became active. next now awaits finalize itself. Continue on a code screen verified nothing and resubmitted the details form; it now verifies the entered code.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
|
🦋 Changeset detectedLatest commit: 4e21cc0 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 |
TaskChooseOrganizationContent renders the task's steps and skeleton with no Card.Root, so another flow can show the task inside its own card. useTaskChooseOrganizationReady reports when the task's data has loaded. The standalone TaskChooseOrganization is unchanged.
clerk-js expects FAPI to clear the sign-up from the client once it completes, and swaps in an empty one after finalize. The fake kept it, which hid the start form flashing while a sign-up leaves.
SignUpView takes a screen and one props object per screen, and each Flow step mounts that screen's component. The controller above the routes holds the details form, so a typed password survives a trip to a verify screen. - Verify routes nest under continue, as in ui, so Back comes from the route. - A verify screen sends its code when it mounts on a step with none out. - While a sign-up finishes, the controller renders the model it left from, so the start form no longer shows when FAPI clears the sign-up. - A choose-organization task renders in the same card on tasks/choose-organization. The code screen stays up until the task's data has loaded.
@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: |
SignUpCodeStep had one caller left once the view stopped rendering step kinds. SignUpVerify now calls its controller and renders the shared VerificationCode block itself.
The local Screen wrapper only typed the step ids. Every other Mosaic view writes Flow.Step, so the wrapper cost more to read than it saved.
The controller and the route test each spelled the rule out, and the test's copy left out the unknown step. Both now call one function from sign-up.routes.ts.
…effect The screen took verifyCode and onVerified and joined them itself, which put the next step type in the view contract. The flow controller now joins them and the screen gets a callback that resolves with nothing.
sign-up.controller.ts keeps what outlives a screen: the route, the form and finishing. The code machine and the verify screen's controller sit in sign-up-verify.controller.ts.
…a reopened verify route
…th enabled The task, organization list and create-organization models take an enabled option, default true, and pass it to the organization list and creation default hooks. A caller that mounts the task model before the session has the task can keep it from fetching.
…model's step The model reports leaving until the task's data has loaded, then task. The finish machine holds the code screen in a handingOff state whose always transition reads the live step, so the TASK_READY event, the effect-only readiness component and finalize's task-or-leaving answer go away. Sign-up mounts the task model with enabled set only while the session has the task, so a sign-up without one fetches no organization lists.
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
Hooks the Mosaic sign-up screens up to Clerk.
SignUpnow takes someone from the first form to a signed-in session: details, email or phone code, then on to the app. It is not exported from the package entry yet.Stacked on #10883. The PRs under that are #10867 and #10868.
How it works
sign-up.view.tsxreads as the list of routes.continue/, like the old sign-up, so Back knows where to go.When the sign-up finishes
taskUrls, sign-up goes there.Not in this PR
Social and OAuth buttons, enterprise SSO, email links, Web3, other phone channels, the Protect check, tickets and invitations, handing off to sign-in, the combined flow, and URL routing (#10780). Where one of these comes up, the user sees Start over. Routing is in-memory only for now.
Changes outside sign-up
blocks/auth, so sign-in can share it.<feature>.routes.tsfile.Different from the old sign-up, on purpose
showOptionalFieldsis set. Same default as before, but it is a prop now.clerk.buildSignInUrl()andclerk.buildWaitlistUrl().Known gaps, not fixed here
SignUpFuture.updatedoes not take one.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change