1- import type { LoadedClerk , SignUpModes } from '@clerk/types' ;
1+ import type { LoadedClerk , SignUpModes , SignUpResource } from '@clerk/types' ;
22
33import { SIGN_UP_MODES } from '../../../core/constants' ;
44import { completeSignUpFlow } from '../SignUp/util' ;
@@ -51,9 +51,12 @@ export function handleCombinedFlowTransfer({
5151 paramsToForward . set ( '__clerk_ticket' , organizationTicket ) ;
5252 }
5353
54- // Attempt to transfer directly to sign up verification if email or phone was used. The signUp.create() call will
54+ // 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
5555 // inform us if the instance is eligible for moving directly to verification.
56- if ( identifierAttribute === 'emailAddress' || identifierAttribute === 'phoneNumber' ) {
56+ if (
57+ ( ! hasOptionalFields ( clerk . client . signUp ) && identifierAttribute === 'emailAddress' ) ||
58+ identifierAttribute === 'phoneNumber'
59+ ) {
5760 return clerk . client . signUp
5861 . create ( {
5962 [ identifierAttribute ] : identifierValue ,
@@ -74,3 +77,15 @@ export function handleCombinedFlowTransfer({
7477
7578 return navigate ( `create?${ paramsToForward . toString ( ) } ` ) ;
7679}
80+
81+ function hasOptionalFields ( signUp : SignUpResource ) {
82+ const filteredFields = signUp . optionalFields . filter (
83+ field =>
84+ ! field . startsWith ( 'oauth_' ) &&
85+ ! field . startsWith ( 'web3_' ) &&
86+ field !== 'password' &&
87+ field !== 'enterprise_sso' &&
88+ field !== 'saml' ,
89+ ) ;
90+ return filteredFields . length > 0 ;
91+ }
0 commit comments