Skip to content

Commit

Permalink
[Fix] - Issue with Email Validation and API Call Trigger on Login #7510
Browse files Browse the repository at this point in the history
… (#7596)

Purpose: Enhance email validation in the SignInUpForm component.

Changes:
- Implemented strict email format validation.
- Disabled the "Continue" button until email validation is complete.
- Displayed error messages for invalid email formats.


![image](https://github.com/user-attachments/assets/62f3c114-002e-4f9f-b18f-5309dfc43587)

---------

Co-authored-by: karankhatik <[email protected]>
Co-authored-by: Charles Bochet <[email protected]>
  • Loading branch information
3 people authored Oct 13, 2024
1 parent 73cb8c5 commit 284b267
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export const SignInUpForm = () => {
if (signInUpStep === SignInUpStep.Init) {
continueWithEmail();
} else if (signInUpStep === SignInUpStep.Email) {
if (isDefined(form?.formState?.errors?.email)) {
setShowErrors(true);
return;
}
continueWithCredentials();
} else if (signInUpStep === SignInUpStep.Password) {
if (!form.formState.isSubmitting) {
Expand Down Expand Up @@ -238,6 +242,10 @@ export const SignInUpForm = () => {
return;
}
if (signInUpStep === SignInUpStep.Email) {
if (isDefined(form?.formState?.errors?.email)) {
setShowErrors(true);
return;
}
continueWithCredentials();
return;
}
Expand Down

0 comments on commit 284b267

Please sign in to comment.