diff --git a/FishFactory/FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs b/FishFactory/FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs index dbf8424..2facaa4 100644 --- a/FishFactory/FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs +++ b/FishFactory/FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs @@ -111,6 +111,10 @@ namespace FishFactoryBusinessLogic.BusinessLogic { Email = model.Email, }); + if (!Regex.IsMatch(model.Email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$")) + { + throw new ArgumentException("Некорретно введенный email", nameof(model.Email)); + } if (!Regex.IsMatch(model.Password, @"^(?=.*\d)(?=.*\W)(?=.*[^\d\s]).+$")) { throw new ArgumentException("Некорректно введенный пароль. Пароль должен содержать хотя бы одну букву, цифру и не буквенный символ", nameof(model.Password));