feature/ email validation to signup form#234
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1846a59514
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| className="py-4 px-4 pl-12 w-full rounded-xl border-2 transition outline-none border-brand-blue/20 bg-surface-2/30 text-[1rem] text-text-strong placeholder:text-text-muted/70 focus:border-brand-blue focus:bg-surface-2/40 focus:shadow-[0_0_0_4px_rgb(var(--brand-blue)/0.12)]" | ||
| /> | ||
| </div> | ||
| {field.name === "email" && emailTouched && formData.email && !isValidEmail(formData.email) && ( |
There was a problem hiding this comment.
Enforce the same email rule before submitting
When the user enters an email that fails this new regex but still satisfies the browser's built-in type="email" constraint, such as user@localhost or a@b, the form shows “Please enter a valid email address” but validate() never checks isValidEmail, so clicking Create Account still calls onSubmit and sends the value to /v1/auth/register. This makes the new validation only cosmetic for those inputs; block submission using the same predicate that drives the inline error.
Useful? React with 👍 / 👎.
Summary
The email validation catches typos like missing @ or incomplete domains immediately, so the user can fix it before even thinking about submitting
the password match indicator removes the guesswork from the confirm password field — users know instantly if they're on track without having to submit and read an error message
Type of Change
[ ] New feature
Affected Components
/frontendMotivation
Security Considerations
Breaking Changes
Rollback Plan
Checklist
Screenshots