Skip to content

Commit 3ddd02c

Browse files
Merge pull request Expensify#68916 from software-mansion-labs/war-in/fix-2fa-after-sign-out
Fix 2FA input not displaying on second sign-in attempt
2 parents ea61b9f + 6d25774 commit 3ddd02c

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx

Lines changed: 12 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,17 @@ 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+
}, [
291+
account?.isLoading,
292+
account?.errors,
293+
account?.requiresTwoFactorAuth,
294+
credentials?.validateCode,
295+
credentials?.accountID,
296+
isUsingRecoveryCode,
297+
recoveryCode,
298+
twoFactorAuthCode,
299+
validateCode,
300+
]);
291301

292302
return (
293303
<SafariFormWrapper>

0 commit comments

Comments
 (0)