diff --git a/FoodOrders/AbstractFoodOrdersBusinessLogic/BusinessLogics/ClientLogic.cs b/FoodOrders/AbstractFoodOrdersBusinessLogic/BusinessLogics/ClientLogic.cs index c2229b6..1f453d4 100644 --- a/FoodOrders/AbstractFoodOrdersBusinessLogic/BusinessLogics/ClientLogic.cs +++ b/FoodOrders/AbstractFoodOrdersBusinessLogic/BusinessLogics/ClientLogic.cs @@ -113,10 +113,9 @@ namespace AbstractFoodOrdersBusinessLogic.BusinessLogics { throw new ArgumentNullException("Введенное не является адресом электронной почты", nameof(model.Email)); } - if (/*model.Password.Length < 10 ||*/ model.Password.Length > 50 /*|| - !Regex.IsMatch(model.Password, @"^((\w+\d+\W+)|(\w+\W+\d+)|(\d+\w+\W+)|(\d+\W+\w+)|(\W+\w+\d+)|(\W+\d+\w+))[\w\d\W]*$")*/) + if (!Regex.IsMatch(model.Password, @"^(?=.*\d)(?=.*\W)(?=.*[^\d\s]).+$")) { - throw new ArgumentNullException("Пароль не соответсвует требованиям безопасности", nameof(model.Password)); + throw new ArgumentException("Некорректно введен пароль клиента", nameof(model.Password)); } _logger.LogInformation("Client. ClientFIO:{ClientFIO}. Password:{Password}. Email:{Email}. Id:{Id}", model.ClientFIO, model.Password, model.Email, model.Id); var element = _clientStorage.GetElement(new ClientSearchModel