diff --git a/src/pages/signin/LoginForm.js b/src/pages/signin/LoginForm.js index 0e8a787d92c6..5f973f7113c1 100644 --- a/src/pages/signin/LoginForm.js +++ b/src/pages/signin/LoginForm.js @@ -112,7 +112,7 @@ function LoginForm(props) { * Check that all the form fields are valid, then trigger the submit callback */ const validateAndSubmitForm = useCallback(() => { - if (props.network.isOffline) { + if (props.network.isOffline || props.account.isLoading) { return; } @@ -149,7 +149,7 @@ function LoginForm(props) { // Check if this login has an account associated with it or not Session.beginSignIn(parsedPhoneNumber.possible ? parsedPhoneNumber.number.e164 : loginTrim); - }, [login, props.closeAccount, props.network, setFormError]); + }, [login, props.account, props.closeAccount, props.network, setFormError]); useEffect(() => { // Just call clearAccountMessages on the login page (home route), because when the user is in the transition route and not yet authenticated, diff --git a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js index a68f99df6d24..41f0d222e80b 100755 --- a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js +++ b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js @@ -194,6 +194,9 @@ function BaseValidateCodeForm(props) { * Check that all the form fields are valid, then trigger the submit callback */ const validateAndSubmitForm = useCallback(() => { + if (props.account.isLoading) { + return; + } const requiresTwoFactorAuth = props.account.requiresTwoFactorAuth; if (requiresTwoFactorAuth) { if (input2FARef.current) { @@ -228,7 +231,7 @@ function BaseValidateCodeForm(props) { } else { Session.signIn(validateCode, twoFactorAuthCode, props.preferredLocale); } - }, [props.account.requiresTwoFactorAuth, props.credentials, props.preferredLocale, twoFactorAuthCode, validateCode]); + }, [props.account, props.credentials, props.preferredLocale, twoFactorAuthCode, validateCode]); return ( <>