From 75b96fe346c20ce5e18204938c35fdef3b9c9516 Mon Sep 17 00:00:00 2001 From: Theo Zourzouvillys Date: Thu, 20 Aug 2026 19:24:26 -0800 Subject: [PATCH] docs(shared,ui): trim the review-flagged comments from #9449 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applies the review suggestions dstaley left on https://github.com/clerk/javascript/pull/9449, which merged before they were addressed: drop the three comments he marked and shorten the changeset. Comment-only — no behaviour change. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_013a2R58ncemGjYAjLHKUpzb --- .changeset/signup-enterprise-sso-redirect-urls.md | 6 +----- .../shared/src/internal/clerk-js/completeSignUpFlow.ts | 1 - packages/ui/src/common/EmailLinkVerify.tsx | 1 - packages/ui/src/components/SignUp/useCompleteSignUpFlow.ts | 7 ------- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/.changeset/signup-enterprise-sso-redirect-urls.md b/.changeset/signup-enterprise-sso-redirect-urls.md index 4905b830f27..0e0675a9bdf 100644 --- a/.changeset/signup-enterprise-sso-redirect-urls.md +++ b/.changeset/signup-enterprise-sso-redirect-urls.md @@ -3,8 +3,4 @@ '@clerk/ui': patch --- -Fix sign-ups that continue into an enterprise SSO connection failing with `invalid_redirect_url` ("Redirect url invalid") instead of redirecting to the identity provider. - -A sign-up does not always know it requires `enterprise_sso` when the form is first submitted — the requirement appears once the identity behind the sign-up is resolved, which can happen several steps later. Whichever step was active at that point performed the hand-off to the identity provider, and most of them did so without the redirect URLs it requires, so the request was rejected and the sign-up dead-ended with no way to continue. Retrying reproduced it every time. Flows that reached SSO directly from the first sign-up form were unaffected, which is why this only showed up on some sign-ups. - -The redirect URLs are now derived from the sign-up context wherever the flow continues, so the hand-off works from every step: the continue form, email-link and code verification, and the verification step that precedes them. +Fix an issue where sign-ups that used an enterprise SSO connection did not correctly forward redirect URLs. diff --git a/packages/shared/src/internal/clerk-js/completeSignUpFlow.ts b/packages/shared/src/internal/clerk-js/completeSignUpFlow.ts index 727ac9b8e9b..69773089ca2 100644 --- a/packages/shared/src/internal/clerk-js/completeSignUpFlow.ts +++ b/packages/shared/src/internal/clerk-js/completeSignUpFlow.ts @@ -32,7 +32,6 @@ export const completeSignUpFlow = ({ return handleComplete && handleComplete(); } else if (signUp.status === 'missing_requirements') { if (signUp.missingFields.some(mf => mf === 'enterprise_sso')) { - // FAPI rejects an empty redirect url, which reaches the user as a dead end rather than the caller as a bug. if (!redirectUrl || !redirectUrlComplete) { throw new Error( 'completeSignUpFlow: `redirectUrl` and `redirectUrlComplete` are required to continue a sign-up that is missing `enterprise_sso`.', diff --git a/packages/ui/src/common/EmailLinkVerify.tsx b/packages/ui/src/common/EmailLinkVerify.tsx index fa624460eaf..9358869871f 100644 --- a/packages/ui/src/common/EmailLinkVerify.tsx +++ b/packages/ui/src/common/EmailLinkVerify.tsx @@ -14,7 +14,6 @@ import { EmailLinkStatusCard } from './EmailLinkStatusCard'; export type EmailLinkVerifyProps = { redirectUrlComplete?: string; redirectUrl?: string; - /** SSO callback url, required only when the verified sign-up still has to hand off to an enterprise connection. */ ssoCallbackUrl?: string; verifyEmailPath?: string; verifyPhonePath?: string; diff --git a/packages/ui/src/components/SignUp/useCompleteSignUpFlow.ts b/packages/ui/src/components/SignUp/useCompleteSignUpFlow.ts index 55851d15b24..59457ab1765 100644 --- a/packages/ui/src/components/SignUp/useCompleteSignUpFlow.ts +++ b/packages/ui/src/components/SignUp/useCompleteSignUpFlow.ts @@ -15,13 +15,6 @@ type CompleteSignUpFlowParams = { handleComplete?: () => Promise; }; -/** - * Binds the sign-up context to `completeSignUpFlow` so callers only pass the routing paths. - * - * `redirectUrl`, `redirectUrlComplete` and `oidcPrompt` are needed by the `enterprise_sso` branch - * but are derived identically at every call site, so binding them here is what keeps a caller from - * silently omitting them. - */ export const useCompleteSignUpFlow = () => { const { navigate } = useRouter(); const { setActive } = useClerk();