fix: auth password validation — min 8 chars, translate to Russian
- sign-in: min 8 chars, translate error messages to Russian - reset-password: min 8 chars (was 6), update placeholder to 8+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a39a76f7a5
commit
71958eadce
|
|
@ -30,7 +30,7 @@ const ResetPasswordSchema = zod
|
||||||
newPassword: zod
|
newPassword: zod
|
||||||
.string()
|
.string()
|
||||||
.min(1, { message: 'Введите пароль!' })
|
.min(1, { message: 'Введите пароль!' })
|
||||||
.min(6, { message: 'Пароль должен содержать не менее 6 символов!' }),
|
.min(8, { message: 'Пароль должен содержать не менее 8 символов!' }),
|
||||||
newPasswordConfirm: zod.string().min(1, { message: 'Подтвердите пароль!' }),
|
newPasswordConfirm: zod.string().min(1, { message: 'Подтвердите пароль!' }),
|
||||||
})
|
})
|
||||||
.refine((data) => data.newPassword === data.newPasswordConfirm, {
|
.refine((data) => data.newPassword === data.newPasswordConfirm, {
|
||||||
|
|
@ -133,7 +133,7 @@ function ResetPasswordContent() {
|
||||||
<Field.Text
|
<Field.Text
|
||||||
name="newPassword"
|
name="newPassword"
|
||||||
label="Новый пароль"
|
label="Новый пароль"
|
||||||
placeholder="6+ символов"
|
placeholder="8+ символов"
|
||||||
type={newPassword.value ? 'text' : 'password'}
|
type={newPassword.value ? 'text' : 'password'}
|
||||||
InputLabelProps={{ shrink: true }}
|
InputLabelProps={{ shrink: true }}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
|
@ -150,7 +150,7 @@ function ResetPasswordContent() {
|
||||||
<Field.Text
|
<Field.Text
|
||||||
name="newPasswordConfirm"
|
name="newPasswordConfirm"
|
||||||
label="Подтвердите пароль"
|
label="Подтвердите пароль"
|
||||||
placeholder="6+ символов"
|
placeholder="8+ символов"
|
||||||
type={newPasswordConfirm.value ? 'text' : 'password'}
|
type={newPasswordConfirm.value ? 'text' : 'password'}
|
||||||
InputLabelProps={{ shrink: true }}
|
InputLabelProps={{ shrink: true }}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@ import { signInWithPassword } from 'src/auth/context/jwt';
|
||||||
export const SignInSchema = zod.object({
|
export const SignInSchema = zod.object({
|
||||||
email: zod
|
email: zod
|
||||||
.string()
|
.string()
|
||||||
.min(1, { message: 'Email is required!' })
|
.min(1, { message: 'Введите email!' })
|
||||||
.email({ message: 'Email must be a valid email address!' }),
|
.email({ message: 'Введите корректный email адрес!' }),
|
||||||
password: zod
|
password: zod
|
||||||
.string()
|
.string()
|
||||||
.min(1, { message: 'Password is required!' })
|
.min(1, { message: 'Введите пароль!' })
|
||||||
.min(6, { message: 'Password must be at least 6 characters!' }),
|
.min(8, { message: 'Пароль должен содержать не менее 8 символов!' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue