Skip to content

Commit

Permalink
Merge pull request #41190 from tienifr/fix/39873
Browse files Browse the repository at this point in the history
fix: two errors appear in validate code page
  • Loading branch information
marcochavezf authored May 1, 2024
2 parents 33a1522 + 26cd1b1 commit 8bd6fc5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,24 @@ function BaseValidateCodeForm({account, credentials, session, autoComplete, isUs
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isLoadingResendValidationForm]);

useEffect(() => {
if (!hasError) {
return;
}

setFormError({});
}, [hasError]);

/**
* Check that all the form fields are valid, then trigger the submit callback
*/
const validateAndSubmitForm = useCallback(() => {
if (account?.isLoading) {
return;
}
if (account?.errors) {
SessionActions.clearAccountMessages();
}
const requiresTwoFactorAuth = account?.requiresTwoFactorAuth;
if (requiresTwoFactorAuth) {
if (input2FARef.current) {
Expand Down

0 comments on commit 8bd6fc5

Please sign in to comment.