Skip to content
Snippets Groups Projects
Unverified Commit ae39f910 authored by Felipe's avatar Felipe Committed by GitHub
Browse files

fix: Incomplete emails are being accepted at user registration (#29115)


* work in progress

* add Error to input box

* Remove console.logs

* fix lint

* fix emailInput and add useDebouncedValue

* change useDebounced time and useForm validation

* fix review

* Create incomplete-emails.md

* fix: simplified changeset

---------

Co-authored-by: default avatarHugo Costa <hugocarreiracosta@gmail.com>
Co-authored-by: default avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: default avatarGabriel Casals <83978645+casalsgh@users.noreply.github.com>
parent 916c0dca
No related branches found
No related tags found
No related merge requests found
---
"@rocket.chat/web-ui-registration": patch
---
✅ Added a new email validation in the Registration Form
......@@ -100,9 +100,13 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo
<TextInput
{...register('email', {
required: true,
pattern: {
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
message: t('registration.component.form.invalidEmail'),
},
})}
placeholder={usernameOrEmailPlaceholder || t('registration.component.form.emailPlaceholder')}
error={errors.email && t('registration.component.form.requiredField')}
error={errors.email && t('registration.component.form.invalidEmail')}
name='email'
aria-invalid={errors.email ? 'true' : undefined}
id='email'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment