Skip to content

Commit e21ae9a

Browse files
docs(shared,ui): address the review comments from #9449 (#9522)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8bc1c9f commit e21ae9a

4 files changed

Lines changed: 1 addition & 14 deletions

File tree

.changeset/signup-enterprise-sso-redirect-urls.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,4 @@
33
'@clerk/ui': patch
44
---
55

6-
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.
7-
8-
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.
9-
10-
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.
6+
Fix an issue where sign-ups that used an enterprise SSO connection did not correctly forward redirect URLs.

packages/shared/src/internal/clerk-js/completeSignUpFlow.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const completeSignUpFlow = ({
3232
return handleComplete && handleComplete();
3333
} else if (signUp.status === 'missing_requirements') {
3434
if (signUp.missingFields.some(mf => mf === 'enterprise_sso')) {
35-
// FAPI rejects an empty redirect url, which reaches the user as a dead end rather than the caller as a bug.
3635
if (!redirectUrl || !redirectUrlComplete) {
3736
throw new Error(
3837
'completeSignUpFlow: `redirectUrl` and `redirectUrlComplete` are required to continue a sign-up that is missing `enterprise_sso`.',

packages/ui/src/common/EmailLinkVerify.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { EmailLinkStatusCard } from './EmailLinkStatusCard';
1414
export type EmailLinkVerifyProps = {
1515
redirectUrlComplete?: string;
1616
redirectUrl?: string;
17-
/** SSO callback url, required only when the verified sign-up still has to hand off to an enterprise connection. */
1817
ssoCallbackUrl?: string;
1918
verifyEmailPath?: string;
2019
verifyPhonePath?: string;

packages/ui/src/components/SignUp/useCompleteSignUpFlow.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ type CompleteSignUpFlowParams = {
1515
handleComplete?: () => Promise<void>;
1616
};
1717

18-
/**
19-
* Binds the sign-up context to `completeSignUpFlow` so callers only pass the routing paths.
20-
*
21-
* `redirectUrl`, `redirectUrlComplete` and `oidcPrompt` are needed by the `enterprise_sso` branch
22-
* but are derived identically at every call site, so binding them here is what keeps a caller from
23-
* silently omitting them.
24-
*/
2518
export const useCompleteSignUpFlow = () => {
2619
const { navigate } = useRouter();
2720
const { setActive } = useClerk();

0 commit comments

Comments
 (0)