From 273f2344345158bbde00f4c7a3d4bc1135da2f6c Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Mon, 16 Dec 2024 15:53:36 -0500 Subject: [PATCH] check for empty signUpUrl --- packages/clerk-js/src/core/clerk.ts | 2 +- packages/clerk-js/src/ui/contexts/components/SignIn.ts | 2 +- packages/clerk-js/src/ui/contexts/components/SignUp.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index 9d4223eb66..e81f6f2024 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -366,7 +366,7 @@ export class Clerk implements ClerkInterface { }; #isCombinedFlow(): boolean { - return this.#options.signInUrl === this.#options.signUpUrl; + return !this.#options.signUpUrl; } public signOut: SignOut = async (callbackOrOptions?: SignOutCallback | SignOutOptions, options?: SignOutOptions) => { diff --git a/packages/clerk-js/src/ui/contexts/components/SignIn.ts b/packages/clerk-js/src/ui/contexts/components/SignIn.ts index eb3e4d7b05..461ec7084a 100644 --- a/packages/clerk-js/src/ui/contexts/components/SignIn.ts +++ b/packages/clerk-js/src/ui/contexts/components/SignIn.ts @@ -33,7 +33,7 @@ export const useSignInContext = (): SignInContextType => { const { queryParams, queryString } = useRouter(); const options = useOptions(); const clerk = useClerk(); - const isCombinedFlow = options.signInUrl === options.signUpUrl; + const isCombinedFlow = !options.signUpUrl; if (context === null || context.componentName !== 'SignIn') { throw new Error(`Clerk: useSignInContext called outside of the mounted SignIn component.`); diff --git a/packages/clerk-js/src/ui/contexts/components/SignUp.ts b/packages/clerk-js/src/ui/contexts/components/SignUp.ts index 48af979506..e37d8256a1 100644 --- a/packages/clerk-js/src/ui/contexts/components/SignUp.ts +++ b/packages/clerk-js/src/ui/contexts/components/SignUp.ts @@ -32,7 +32,7 @@ export const useSignUpContext = (): SignUpContextType => { const { queryParams, queryString } = useRouter(); const options = useOptions(); const clerk = useClerk(); - const isCombinedFlow = options.signInUrl === options.signUpUrl; + const isCombinedFlow = !options.signUpUrl; const initialValuesFromQueryParams = useMemo( () => getInitialValuesFromQueryParams(queryString, SIGN_UP_INITIAL_VALUE_KEYS),