-
Notifications
You must be signed in to change notification settings - Fork 431
fix(js,ui,shared): Handle unsafeMetadata in transfer flows
#7661
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
fix(js,ui,shared): Handle unsafeMetadata in transfer flows
#7661
Conversation
🦋 Changeset detectedLatest commit: de66595 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@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: |
📝 WalkthroughWalkthroughThis PR propagates an optional Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
jacekradko
left a comment
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.
Just a changeset update
Co-authored-by: Jacek Radko <jacek@clerk.dev>
Description
Port of Core 2 changes: #7646
Summary
unsafeMetadatabeing lost when users are transferred between sign-in and sign-up flows during OAuth/SSO authenticationunsafeMetadatatoHandleOAuthCallbackParamstype and propagates it through transfer flows<SignIn>or<SignUp>components is preserved when OAuth transfers occurProblem
When
unsafeMetadatais passed to<SignIn unsafeMetadata={{ foo: 'bar' }} />or<SignUp unsafeMetadata={{ foo: 'bar' }} />, the metadata was lost in two scenarios:OAuth/SSO Callback Transfer: When a user signs in via OAuth but no account exists, the system transfers to sign-up by calling signUp.create({ transfer: true }) without passing unsafeMetadata
Combined Flow Transfer: When the combined sign-in/sign-up flow detects a non-existent identifier and transfers to sign-up,
signUp.create()was called withoutunsafeMetadataSolution
unsafeMetadatafield toHandleOAuthCallbackParamstypeunsafeMetadatafrom params tosignUp.create()during OAuth transfer inclerk.tsunsafeMetadatatoHandleCombinedFlowTransferPropsand pass it tosignUp.create()inhandleCombinedFlowTransfer.tsunsafeMetadatafrom context to SSO callback components in both SignIn and SignUp routesChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.