From ec464766b14196dd1378f894edb28545987f8f8f Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Fri, 20 Dec 2024 15:32:47 -0500 Subject: [PATCH] add check for password enabled --- packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx | 1 + .../src/ui/components/SignIn/handleCombinedFlowTransfer.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx index a35371b199..a4895912d6 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx @@ -387,6 +387,7 @@ export function _SignInStart(): JSX.Element { signUpMode: userSettings.signUp.mode, redirectUrl, redirectUrlComplete, + passwordEnabled: userSettings.attributes.password.required, }); } else { handleError(e, [identifierField, instantPasswordField], card.setError); diff --git a/packages/clerk-js/src/ui/components/SignIn/handleCombinedFlowTransfer.ts b/packages/clerk-js/src/ui/components/SignIn/handleCombinedFlowTransfer.ts index bad25a763d..7155b2a03f 100644 --- a/packages/clerk-js/src/ui/components/SignIn/handleCombinedFlowTransfer.ts +++ b/packages/clerk-js/src/ui/components/SignIn/handleCombinedFlowTransfer.ts @@ -14,6 +14,7 @@ type HandleCombinedFlowTransferProps = { handleError: (err: any) => void; redirectUrl?: string; redirectUrlComplete?: string; + passwordEnabled: boolean; }; /** @@ -31,6 +32,7 @@ export function handleCombinedFlowTransfer({ handleError, redirectUrl, redirectUrlComplete, + passwordEnabled, }: HandleCombinedFlowTransferProps): Promise | void { if (signUpMode === SIGN_UP_MODES.WAITLIST) { const waitlistUrl = clerk.buildWaitlistUrl( @@ -54,7 +56,7 @@ export function handleCombinedFlowTransfer({ // Attempt to transfer directly to sign up verification if email or phone was used and there are no optional fields. The signUp.create() call will // inform us if the instance is eligible for moving directly to verification. if ( - (!hasOptionalFields(clerk.client.signUp) && identifierAttribute === 'emailAddress') || + (!passwordEnabled && !hasOptionalFields(clerk.client.signUp) && identifierAttribute === 'emailAddress') || identifierAttribute === 'phoneNumber' ) { return clerk.client.signUp