fix(clerk-js): Correct locale inconsistencies when creating SignUpFuture#8762
Conversation
When password() created a new sign-up (no existing sign-up id), it did not apply the browser-locale fallback that create() applies, so the sign-up was created without a locale unless one was passed explicitly. Inject the fallback on the create path only, so updating an existing sign-up does not overwrite a previously set locale. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 02821cc 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 GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR fixes locale handling in the ChangesSignUp Future API locale and parameter handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
Break Check: no API changes detected across the tracked packages. Last ran on |
wobsoriano
left a comment
There was a problem hiding this comment.
ahh this makes sense! thanks for adding
|
Thanks @wobsoriano for the approval, and thanks to Support Rotation for leading me to look into this code for a customer 👍 |
Description
We have five different ways to create a
SignUpwithSignUpFutureand they have inconsistent handling of params and the browser locale:create: Uses a param or browser fallback to set locale.password: This does not apply the browser-locale fallback but does use the param. Fixed in this PR to use the fallback only on POST.web3: This delegates to_createbut did not pass alonglocaleor first or last name, meaning that it always got the fallback behavior. Fixed in this PR to pass all three params.ticket: Handles correctlysso: This doesn't apply anylocaleat all. (It also doesn't take first and last name but since we generally get this from the SSO provider I didn't include it.)These changes now align our API with the contract in our types
SignUpFutureAdditionalParamswhich listslocaleas a parameter and says we will fall back to the browser's locale.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
Bug Fixes
signUp.password()andsignUp.sso()now default to the browser locale when creating new sign-ups, matchingsignUp.create().signUp.web3()now forwardsfirstName,lastName, andlocalewhen creating a sign-up.Tests