-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] - Issue with Email Validation and API Call Trigger on Login #7510 #7596
[Fix] - Issue with Email Validation and API Call Trigger on Login #7510 #7596
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request enhances email validation in the SignInUpForm component, improving user experience and data integrity during the sign-in/up process.
- Implemented strict email format validation in
packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpForm.tsx
- Added logic to disable the "Continue" button until email validation is complete
- Introduced error message display for invalid email formats
- Improved user feedback by preventing submission of invalid email addresses
- Enhanced the overall sign-in/up flow by ensuring valid email input before proceeding
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
if (form?.formState?.errors?.email) { | ||
setShowErrors(true); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider moving this validation logic to the continueWithCredentials
function for better separation of concerns.
Hi @Karankhatik, thanks for your PR. We would like the validation check to occur only when the "Continue" button is pressed, rather than while the user is typing. We don't want to show an error message if the user hasn't completed their input. |
@@ -76,6 +76,10 @@ export const SignInUpForm = () => { | |||
if (signInUpStep === SignInUpStep.Init) { | |||
continueWithEmail(); | |||
} else if (signInUpStep === SignInUpStep.Email) { | |||
if (isDefined(form?.formState?.errors?.email)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using isDefined is better to avoid unwanted falsy behaviors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Karankhatik. I have made a small modification :)
Thanks @Karankhatik for your contribution! |
Purpose: Enhance email validation in the SignInUpForm component.
Changes: