@@ -74,7 +74,13 @@ export class SignUp extends BaseResource implements SignUpResource {
7474 const { captchaSiteKey, canUseCaptcha, captchaURL, captchaWidgetType, captchaProvider, captchaPublicKeyInvisible } =
7575 retrieveCaptchaInfo ( SignUp . clerk ) ;
7676
77- if ( canUseCaptcha && captchaSiteKey && captchaURL && captchaPublicKeyInvisible ) {
77+ if (
78+ ! this . shouldBypassCaptchaForAttempt ( params ) &&
79+ canUseCaptcha &&
80+ captchaSiteKey &&
81+ captchaURL &&
82+ captchaPublicKeyInvisible
83+ ) {
7884 try {
7985 const { captchaToken, captchaWidgetTypeUsed } = await getCaptchaToken ( {
8086 siteKey : captchaSiteKey ,
@@ -94,6 +100,10 @@ export class SignUp extends BaseResource implements SignUpResource {
94100 }
95101 }
96102
103+ if ( params . transfer && this . shouldBypassCaptchaForAttempt ( params ) ) {
104+ paramsWithCaptcha . strategy = SignUp . clerk . client ?. signIn . firstFactorVerification . strategy ;
105+ }
106+
97107 return this . _basePost ( {
98108 path : this . pathRoot ,
99109 body : normalizeUnsafeMetadata ( paramsWithCaptcha ) ,
@@ -324,4 +334,27 @@ export class SignUp extends BaseResource implements SignUpResource {
324334 }
325335 return this ;
326336 }
337+
338+ /**
339+ * We delegate bot detection to the following providers, instead of relying on turnstile exclusively
340+ */
341+ protected shouldBypassCaptchaForAttempt ( params : SignUpCreateParams ) {
342+ if (
343+ params . strategy === 'oauth_google' ||
344+ params . strategy === 'oauth_microsoft' ||
345+ params . strategy === 'oauth_apple'
346+ ) {
347+ return true ;
348+ }
349+ if (
350+ params . transfer &&
351+ ( SignUp . clerk . client ?. signIn . firstFactorVerification . strategy === 'oauth_google' ||
352+ SignUp . clerk . client ?. signIn . firstFactorVerification . strategy === 'oauth_microsoft' ||
353+ SignUp . clerk . client ?. signIn . firstFactorVerification . strategy === 'oauth_apple' )
354+ ) {
355+ return true ;
356+ }
357+
358+ return false ;
359+ }
327360}
0 commit comments