diff --git a/backend/src/PnvPanel.Application/Auth/ChangePassword/ChangePasswordCommandValidator.cs b/backend/src/PnvPanel.Application/Auth/ChangePassword/ChangePasswordCommandValidator.cs index 03d62be..0c83578 100644 --- a/backend/src/PnvPanel.Application/Auth/ChangePassword/ChangePasswordCommandValidator.cs +++ b/backend/src/PnvPanel.Application/Auth/ChangePassword/ChangePasswordCommandValidator.cs @@ -10,7 +10,7 @@ public sealed class ChangePasswordCommandValidator : AbstractValidator x.NewPassword) .NotEmpty() .MinimumLength(8) - .Matches("^(?=.*[A-Z])(?=.*[0-9]).+$") + .Matches(@"^(?=.*\p{Lu})(?=.*\d).+$") .WithMessage("Пароль должен содержать минимум одну заглавную букву и одну цифру."); } } diff --git a/backend/src/PnvPanel.Application/Auth/Register/RegisterCommandValidator.cs b/backend/src/PnvPanel.Application/Auth/Register/RegisterCommandValidator.cs index af11994..cef69f7 100644 --- a/backend/src/PnvPanel.Application/Auth/Register/RegisterCommandValidator.cs +++ b/backend/src/PnvPanel.Application/Auth/Register/RegisterCommandValidator.cs @@ -15,7 +15,7 @@ public sealed class RegisterCommandValidator : AbstractValidator x.Password) .NotEmpty() .MinimumLength(8) - .Matches("^(?=.*[A-Z])(?=.*[0-9]).+$") + .Matches(@"^(?=.*\p{Lu})(?=.*\d).+$") .WithMessage("Пароль должен содержать минимум одну заглавную букву и одну цифру."); } } diff --git a/frontend/src/features/auth/RegisterForm.tsx b/frontend/src/features/auth/RegisterForm.tsx index 16e8be9..d1fc4d2 100644 --- a/frontend/src/features/auth/RegisterForm.tsx +++ b/frontend/src/features/auth/RegisterForm.tsx @@ -18,7 +18,7 @@ const schema = z.object({ password: z .string() .min(8) - .regex(/^(?=.*[A-Z])(?=.*[0-9]).+$/), + .regex(/^(?=.*\p{Lu})(?=.*\d).+$/u), }) type FormValues = z.infer diff --git a/frontend/src/features/settings/ChangePasswordForm.tsx b/frontend/src/features/settings/ChangePasswordForm.tsx index e2794f4..e2abafa 100644 --- a/frontend/src/features/settings/ChangePasswordForm.tsx +++ b/frontend/src/features/settings/ChangePasswordForm.tsx @@ -15,7 +15,7 @@ const schema = z.object({ newPassword: z .string() .min(8) - .regex(/^(?=.*[A-Z])(?=.*[0-9]).+$/), + .regex(/^(?=.*\p{Lu})(?=.*\d).+$/u), }) type FormValues = z.infer