Skip to content

Commit

Permalink
add check for password enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcarpenter committed Dec 20, 2024
1 parent 69fd8a9 commit ec46476
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type HandleCombinedFlowTransferProps = {
handleError: (err: any) => void;
redirectUrl?: string;
redirectUrlComplete?: string;
passwordEnabled: boolean;
};

/**
Expand All @@ -31,6 +32,7 @@ export function handleCombinedFlowTransfer({
handleError,
redirectUrl,
redirectUrlComplete,
passwordEnabled,
}: HandleCombinedFlowTransferProps): Promise<unknown> | void {
if (signUpMode === SIGN_UP_MODES.WAITLIST) {
const waitlistUrl = clerk.buildWaitlistUrl(
Expand All @@ -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
Expand Down

0 comments on commit ec46476

Please sign in to comment.