mirror of
https://github.com/strapi/strapi.git
synced 2025-11-08 14:19:40 +00:00
Merge pull request #12091 from strapi/fix/12089
Add lowercase validation to email for registering admin user.
This commit is contained in:
commit
0605c0e25e
@ -178,7 +178,10 @@ const Register = ({ fieldsToDisable, noSignin, onSubmit, schema }) => {
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
required
|
required
|
||||||
label={formatMessage({ id: 'Auth.form.email.label', defaultMessage: 'Email' })}
|
label={formatMessage({
|
||||||
|
id: 'Auth.form.email.label',
|
||||||
|
defaultMessage: 'Email',
|
||||||
|
})}
|
||||||
type="email"
|
type="email"
|
||||||
/>
|
/>
|
||||||
<PasswordInput
|
<PasswordInput
|
||||||
|
|||||||
@ -94,6 +94,8 @@ const forms = {
|
|||||||
email: yup
|
email: yup
|
||||||
.string()
|
.string()
|
||||||
.email(translatedErrors.email)
|
.email(translatedErrors.email)
|
||||||
|
.strict()
|
||||||
|
.lowercase(translatedErrors.lowercase)
|
||||||
.required(translatedErrors.required),
|
.required(translatedErrors.required),
|
||||||
confirmPassword: yup
|
confirmPassword: yup
|
||||||
.string()
|
.string()
|
||||||
|
|||||||
@ -407,6 +407,7 @@
|
|||||||
"components.Input.error.password.noMatch": "Passwords do not match",
|
"components.Input.error.password.noMatch": "Passwords do not match",
|
||||||
"components.Input.error.validation.email": "This is an invalid email",
|
"components.Input.error.validation.email": "This is an invalid email",
|
||||||
"components.Input.error.validation.json": "This doesn't match the JSON format",
|
"components.Input.error.validation.json": "This doesn't match the JSON format",
|
||||||
|
"components.Input.error.validation.lowercase": "The value must be a lowercase string",
|
||||||
"components.Input.error.validation.max": "The value is too high.",
|
"components.Input.error.validation.max": "The value is too high.",
|
||||||
"components.Input.error.validation.maxLength": "The value is too long.",
|
"components.Input.error.validation.maxLength": "The value is too long.",
|
||||||
"components.Input.error.validation.min": "The value is too low.",
|
"components.Input.error.validation.min": "The value is too low.",
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
const errorsTrads = {
|
const errorsTrads = {
|
||||||
email: 'components.Input.error.validation.email',
|
email: 'components.Input.error.validation.email',
|
||||||
json: 'components.Input.error.validation.json',
|
json: 'components.Input.error.validation.json',
|
||||||
|
lowercase: 'components.Input.error.validation.lowercase',
|
||||||
max: 'components.Input.error.validation.max',
|
max: 'components.Input.error.validation.max',
|
||||||
maxLength: 'components.Input.error.validation.maxLength',
|
maxLength: 'components.Input.error.validation.maxLength',
|
||||||
min: 'components.Input.error.validation.min',
|
min: 'components.Input.error.validation.min',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user