Skip to content

Commit 6e29e5c

Browse files
committed
run 2fa validation once validateCode has been submitted
1 parent 6cbd35e commit 6e29e5c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function BaseValidateCodeForm({autoComplete, isUsingRecoveryCode, setIsUsingReco
238238
clearAccountMessages();
239239
}
240240
const requiresTwoFactorAuth = account?.requiresTwoFactorAuth;
241-
if (requiresTwoFactorAuth) {
241+
if (requiresTwoFactorAuth && !!credentials?.validateCode) {
242242
if (input2FARef.current) {
243243
input2FARef.current.blur();
244244
}
@@ -287,7 +287,7 @@ function BaseValidateCodeForm({autoComplete, isUsingRecoveryCode, setIsUsingReco
287287
} else {
288288
signIn(validateCode, recoveryCodeOr2faCode);
289289
}
290-
}, [account?.isLoading, account?.errors, account?.requiresTwoFactorAuth, isUsingRecoveryCode, recoveryCode, twoFactorAuthCode, credentials?.accountID, validateCode]);
290+
}, [account?.isLoading, account?.errors, account?.requiresTwoFactorAuth, credentials?.validateCode, credentials?.accountID, isUsingRecoveryCode, recoveryCode, twoFactorAuthCode, validateCode]);
291291

292292
return (
293293
<SafariFormWrapper>

0 commit comments

Comments
 (0)