@@ -9,7 +9,7 @@ import { Signup } from '.';
99import { useValidatedQueryParams } from '../../lib/hooks/useValidate' ;
1010import { SignupQueryParams } from '../../models/pages/signup' ;
1111import { BeginSignupHandler , SignupIntegration } from './interfaces' ;
12- import { useCallback , useEffect } from 'react' ;
12+ import { useCallback , useEffect , useRef } from 'react' ;
1313import { handleAuthClientError } from './utils' ;
1414import {
1515 getCredentials ,
@@ -87,13 +87,21 @@ const SignupContainer = ({
8787
8888 const wantsKeys = integration . wantsKeys ( ) ;
8989
90+ const attemptedEmailStatusCheck = useRef ( false ) ;
91+
9092 useEffect ( ( ) => {
9193 ( async ( ) => {
92- if ( ! validationError && ! emailStatusChecked ) {
94+ if (
95+ ! validationError &&
96+ ! emailStatusChecked &&
97+ ! attemptedEmailStatusCheck . current
98+ ) {
99+ attemptedEmailStatusCheck . current = true ;
93100 const { exists, hasLinkedAccount, hasPassword, passwordlessSupported } =
94101 await authClient . accountStatusByEmail ( queryParamModel . email , {
95102 thirdPartyAuthStatus : true ,
96103 clientId : integration . getClientId ( ) ,
104+ service : integration . getService ( ) ,
97105 } ) ;
98106 if ( exists ) {
99107 const signInPath = location . pathname . startsWith ( '/oauth' )
@@ -120,7 +128,8 @@ const SignupContainer = ({
120128 }
121129 }
122130 } ) ( ) ;
123- } ) ;
131+ // eslint-disable-next-line react-hooks/exhaustive-deps
132+ } , [ ] ) ;
124133
125134 const beginSignupHandler : BeginSignupHandler = useCallback (
126135 async ( email , password ) => {
@@ -145,11 +154,11 @@ const SignupContainer = ({
145154 let credentialsV2 = undefined ;
146155 let v2Payload :
147156 | {
148- wrapKb : string ;
149- authPWVersion2 : string ;
150- wrapKbVersion2 : string ;
151- clientSalt : string ;
152- }
157+ wrapKb : string ;
158+ authPWVersion2 : string ;
159+ wrapKbVersion2 : string ;
160+ clientSalt : string ;
161+ }
153162 | { } = { } ;
154163
155164 if ( keyStretchExp . queryParamModel . isV2 ( config ) ) {
0 commit comments