ani1609/Spendwise

Validation for email field in Signup form

Closed this issue · 7 comments

Bug
During signup, entering only "mail@a" as the email address is incorrectly accepted. This email lacks the expected format with a domain name and top-level domain, making it invalid.

Solution
This can be fixed with ZOD validation library.

Screenshots
image
This get's accepted and I got signedup!

@ani1609 @niladrix719 Please assign this issue to me. I am learning express and learned about ZOD validation library, so I think I can fix this bug for KWoC.

@Anuj-Gill we have decided to shift the authentication process to firebase authentication where the users will be sent a verification link over email. Will your idea be helpful in that scenario?

@ani1609 I believe yes, because we can use ZOD to pre-validate the email address format before sending it to Firebase for verification. This can improve server efficiency by catching obvious errors beforehand.

@Anuj-Gill sure go ahead

@Anuj-Gill any update?

@ani1609 I have created a PR. Please have a look.