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
|
||||
.string()
|
||||
.min(1, { message: 'Введите пароль!' })
|
||||
.min(6, { message: 'Пароль должен содержать не менее 6 символов!' }),
|
||||
.min(8, { message: 'Пароль должен содержать не менее 8 символов!' }),
|
||||
newPasswordConfirm: zod.string().min(1, { message: 'Подтвердите пароль!' }),
|
||||
})
|
||||
.refine((data) => data.newPassword === data.newPasswordConfirm, {
|
||||
|
|
@ -133,7 +133,7 @@ function ResetPasswordContent() {
|
|||
<Field.Text
|
||||
name="newPassword"
|
||||
label="Новый пароль"
|
||||
placeholder="6+ символов"
|
||||
placeholder="8+ символов"
|
||||
type={newPassword.value ? 'text' : 'password'}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
InputProps={{
|
||||
|
|
@ -150,7 +150,7 @@ function ResetPasswordContent() {
|
|||
<Field.Text
|
||||
name="newPasswordConfirm"
|
||||
label="Подтвердите пароль"
|
||||
placeholder="6+ символов"
|
||||
placeholder="8+ символов"
|
||||
type={newPasswordConfirm.value ? 'text' : 'password'}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
InputProps={{
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ import { signInWithPassword } from 'src/auth/context/jwt';
|
|||
export const SignInSchema = zod.object({
|
||||
email: zod
|
||||
.string()
|
||||
.min(1, { message: 'Email is required!' })
|
||||
.email({ message: 'Email must be a valid email address!' }),
|
||||
.min(1, { message: 'Введите email!' })
|
||||
.email({ message: 'Введите корректный email адрес!' }),
|
||||
password: zod
|
||||
.string()
|
||||
.min(1, { message: 'Password is required!' })
|
||||
.min(6, { message: 'Password must be at least 6 characters!' }),
|
||||
.min(1, { message: 'Введите пароль!' })
|
||||
.min(8, { message: 'Пароль должен содержать не менее 8 символов!' }),
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in New Issue