fix(ui): correct OAuth redirect_url for openSignUp modal in combined flow#8388
fix(ui): correct OAuth redirect_url for openSignUp modal in combined flow#8388nikosdouvlis wants to merge 1 commit intomainfrom
Conversation
…flow Follow up to #8385. When CLERK_SIGN_UP_URL is unset (combined flow config) and a customer calls openSignUp() directly, signUpUrl in SignUp.ts falls back to displayConfig.signUpUrl, which is the accounts portal. For customers that dont use the accounts portal, the OAuth redirect_url ends up on the wrong origin. Anchor the callback base to options.signInUrl when in a combined-flow modal, since the create/sso-callback and create/verify routes are mounted under the SignIn tree.
🦋 Changeset detectedLatest commit: 11f1773 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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.
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@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: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis pull request fixes an OAuth redirect URL issue in the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Detailed analysisChangesets documentation: Introduces a patch-level change note for Test coverage: Adds a focused Playwright test that mirrors the existing Implementation logic: Updates the SignUp context component to conditionally compute a The changes are cohesive in addressing a single issue but require careful verification that the callback URL routing logic functions correctly under the combined-flow conditions specified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Why
Follow up to #8385. When a customer configures combined flow (CLERK_SIGN_IN_URL set, CLERK_SIGN_UP_URL unset, public signup mode) and calls openSignUp() directly, signUpUrl in SignUp.ts falls back to displayConfig.signUpUrl, which is the accounts portal. Customers that dont use the accounts portal end up with a broken OAuth redirect_url on the wrong origin.
The SignIn side of the same bug was fixed in #8385, but the openSignUp path wasnt touched.
What changed
Anchor the callback base to options.signInUrl when in a combined-flow modal. The create/sso-callback and create/verify routes are mounted under the SignIn tree (packages/ui/src/components/SignIn/index.tsx), so the redirect resolves against the app origin and lands on LazySignUpSSOCallback.
Path and hash routing are unchanged since buildRedirectUrl ignores baseUrl for those modes, so this is modal-only.
Test coverage
Added an integration test in integration/tests/oauth-flows.test.ts that exercises openSignUp with the same withSignInOrUpFlow fixture #8385 uses, asserting the redirect_url lands on /sign-in#/create/sso-callback.
Packages affected