From 3cdd3adf5e5952e8fb041506a4b742c9fd5d051c Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Thu, 2 Jul 2026 14:52:46 +0300 Subject: [PATCH] Enhance password policy and update hints for user registration - Updated password requirements in the dependency injection configuration to enforce the use of at least one digit and one uppercase letter. - Modified password hint messages in both Russian and English to reflect the new password policy, ensuring clarity for users during registration. --- backend/src/PnvPanel.Infrastructure/DependencyInjection.cs | 3 +++ frontend/src/shared/lib/i18n.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/PnvPanel.Infrastructure/DependencyInjection.cs b/backend/src/PnvPanel.Infrastructure/DependencyInjection.cs index 5574d21..6fc3bb6 100644 --- a/backend/src/PnvPanel.Infrastructure/DependencyInjection.cs +++ b/backend/src/PnvPanel.Infrastructure/DependencyInjection.cs @@ -39,6 +39,9 @@ public static class DependencyInjection { options.User.RequireUniqueEmail = false; options.Password.RequiredLength = 8; + options.Password.RequireDigit = true; + options.Password.RequireUppercase = true; + options.Password.RequireNonAlphanumeric = false; options.Lockout.MaxFailedAccessAttempts = 5; options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(5); options.Lockout.AllowedForNewUsers = true; diff --git a/frontend/src/shared/lib/i18n.ts b/frontend/src/shared/lib/i18n.ts index 5821d04..7ff05a2 100644 --- a/frontend/src/shared/lib/i18n.ts +++ b/frontend/src/shared/lib/i18n.ts @@ -28,7 +28,7 @@ const resources = { duplicateUserName: 'Пользователь с таким именем уже существует.', genericError: 'Что-то пошло не так. Попробуйте ещё раз.', userNameHint: 'Латиница, цифры, «_», «.», «-», от 3 до 32 символов.', - passwordHint: 'Не менее 8 символов.', + passwordHint: 'Не менее 8 символов, минимум одна заглавная буква и одна цифра.', or: 'или', telegramBotNotConfigured: 'Telegram-бот не настроен администратором.', waitingForConfirmation: 'Ожидание подтверждения в Telegram…', @@ -289,7 +289,7 @@ const resources = { duplicateUserName: 'A user with this name already exists.', genericError: 'Something went wrong. Please try again.', userNameHint: 'Latin letters, digits, "_", ".", "-", 3 to 32 characters.', - passwordHint: 'At least 8 characters.', + passwordHint: 'At least 8 characters, with one uppercase letter and one digit.', or: 'or', telegramBotNotConfigured: 'The Telegram bot has not been configured by the administrator.', waitingForConfirmation: 'Waiting for confirmation in Telegram…',