cyrillic email regex
This commit is contained in:
@@ -16,13 +16,21 @@ export type FormAction = (
|
||||
formData: FormData
|
||||
) => Promise<FormState>
|
||||
|
||||
const emailRegex = /^([a-zA-Z0-9.\-_]+|[а-яА-ЯёЁ0-9.\-_]+)@(([a-zA-Z0-9.\-]+)\.([a-zA-Z]{2,})|([a-zA-Z0-9.\-]+)\.([а-яА-ЯёЁ]{2,})|([а-яА-ЯёЁ0-9.\-]+)\.([a-zA-Z]{2,})|([а-яА-ЯёЁ0-9.\-]+)\.([а-яА-ЯёЁ]{2,}))$/i;
|
||||
|
||||
export const SignupFormSchema = z
|
||||
.object({
|
||||
full_name: z
|
||||
.string()
|
||||
.min(3, { error: 'register-error-name' })
|
||||
.trim(),
|
||||
email: z.email({ error: 'register-error-valid-email' }).trim(),
|
||||
email: z
|
||||
.string()
|
||||
.trim()
|
||||
.refine(
|
||||
(value) => emailRegex.test(value),
|
||||
{ message: 'register-error-valid-email' }
|
||||
),
|
||||
phone: z
|
||||
.string()
|
||||
.min(12, { error: 'register-error-phone' }),
|
||||
|
||||
Reference in New Issue
Block a user