-
Notifications
You must be signed in to change notification settings - Fork 357
feat(clerk-js): Handle needs_new_password
status on sign in
#6106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 20c440c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 WalkthroughWalkthroughThe changes update two sign-in related components to handle a new response status, 'needs_new_password', by adding cases in their respective switch statements. When this status is encountered, the components now navigate to the '../reset-password' route. No other logic or exported entities are altered. Changes
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePasswordCard.tsx (1)
79-81
: Hard-coded route string duplicated – consider extracting to a shared constantThis file and
SignInStart.tsx
both embed the literal'../reset-password'
. Duplicated literal routes easily drift apart. Define a smallROUTES
enum / constant (e.g.ROUTES.resetPassword
) in./shared
and import it in both locations for maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePasswordCard.tsx
(1 hunks)packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Build Packages
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: semgrep/ci
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx (1)
232-233
: Verify relative path –../reset-password
may jump outside the /sign-in segment
SignInStart
currently navigates to siblings withnavigate('factor-one')
/navigate('factor-two')
, i.e. no../
prefix.
Adding../
here makes the runtime resolve one level up:/sign-in/start -> ../reset-password ==> /reset-password
If the reset-password route is meant to stay under
/sign-in
, this will mis-route users and potentially break SSR/hashes. Please cross-check the router tree; in most Clerk flows the correct sibling would be plain'reset-password'
.- case 'needs_new_password': - return navigate('../reset-password'); + case 'needs_new_password': + return navigate('reset-password'); // adjust if route is indeed sibling
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/neat-cloths-dig.md (1)
5-5
: Enhance summary clarity.
Consider expanding this line to note that users will now be redirected to"../reset-password"
when theneeds_new_password
status is encountered, so the intent and UX impact are crystal clear.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.changeset/neat-cloths-dig.md
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep/ci
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
.changeset/neat-cloths-dig.md (1)
1-3
: Confirm bump type aligns with semantic versioning.
Adding support for a new sign-in status is non-breaking user-facing functionality, so a minor bump is appropriate here.
!snapshot |
Hey @brkalow - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
@@ -0,0 +1,5 @@ | |||
--- | |||
'@clerk/clerk-js': minor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'@clerk/clerk-js': minor | |
'@clerk/clerk-js': patch |
Description
Handle
needs_new_password
inSignInStart
andSignInFactorOnePasswordCard
.Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit