Repository navigation
feat(mosaic,nextjs): add TaskResetPassword - #11134
Draft
austincalvelage wants to merge 5 commits into
Draft
austincalvelage wants to merge 5 commits into
austincalvelage wants to merge 5 commits into
Conversation
…nges a password FAPI removes the reset-password task from the requesting session when the password changes, and the session becomes active once no task is left. The fake now does the same, so a feature test can follow a reset into the next task or redirectUrlComplete.
Port the behaviors the legacy TaskResetPassword tests cover, and the task guard, completion, reverification, password checks and multi-session sign-out, as one feature test against the fake FAPI. The tests fail until TaskResetPassword exists.
Add a Mosaic TaskResetPassword that resolves the reset-password session task with legacy parity: a new password and its confirmation, live password rules, field errors for passwords Clerk rejects, the sign-out-of-other-devices choice, step-up verification when Clerk asks for it, and a footer that signs out this account or every account. On success it continues to the next task or redirectUrlComplete. Export it and its props from @clerk/mosaic/ui and @clerk/nextjs/preview.
|
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: 6af3352 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
@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: |
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
Adds
TaskResetPasswordto Mosaic and exports it from@clerk/nextjs/preview. It resolves thereset-passwordsession task the way@clerk/ui's<TaskResetPassword />does, built on Mosaic's model, controller and view split likeTaskSetupMFAandTaskChooseOrganization.Shared changes (for Mosaic reviewers)
POST /v1/me/change_passwordnow removesreset-passwordfrom the session's tasks and activates the session when none is left, asCompleteSessionTaskdoes in FAPI.TaskChooseOrganizationandTaskSetupMFA. Each is now copied in three places, so a shared "continue after task" and password check are worth pulling out next.1. The form matches
ui's. New password and confirm password, with the instance's password rules shown live as the user types, and a "Sign out of all other devices" checkbox that starts checked. Clerk's password errors land on the new-password field through the samepasswordFormErrorsign-up and user profile use.2. Finishing goes where
uigoes. After the password changes, the user continues to their next task throughtaskUrlsor the built task URL, or toredirectUrlCompletewhen none is left. Step-up verification shows inline, as inTaskSetupMFA, whereuiopens a modal.3. The guards match
withTaskGuard. A visitor with no session goes to sign-in, and a session without the task goes toredirectUrlComplete, falling back to the after-sign-in URL. The sign-out footer signs out only this session when others are signed in, asui's does. Signing out mid-task leaves the user on the sign-out destination instead of redirecting to sign-in afterward.JSDoc for review.
Known gaps
uishows a green "Passwords match." under the confirm field. Mosaic shows only the mismatch, as its user-profile password dialog does.uihas "Reset Password"./sign-in#/tasks/reset-passwordyet, so an app mounts it or setstaskUrls, as withTaskSetupMFA.TaskSetupMFAnavigates twice after a footer sign-out, and its finish ignorestaskUrls. This PR doesn't change it.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code