не робит

This commit is contained in:
Полина Чубыкина 2024-05-18 16:23:07 +04:00
parent 4b880a78c7
commit cffdbd43dc
3 changed files with 8 additions and 15 deletions

View File

@ -1,14 +1,9 @@
using ConfectioneryContracts.ViewModels;
using ConfectioneryContracts.BindingModels;
using ConfectioneryContracts.BindingModels;
using ConfectioneryContracts.BusinessLogicsContracts;
using ConfectioneryContracts.SearchModels;
using ConfectioneryContracts.StoragesContracts;
using ConfectioneryContracts.ViewModels;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
namespace ConfectioneryBusinessLogic.BusinessLogics
@ -103,16 +98,14 @@ namespace ConfectioneryBusinessLogic.BusinessLogics
{
throw new ArgumentNullException("Нет ФИО клиента", nameof(model.ClientFIO));
}
if (string.IsNullOrEmpty(model.Email) || !Regex.IsMatch(model.Email, @"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$", RegexOptions.IgnoreCase))
if (string.IsNullOrEmpty(model.Email) || !Regex.IsMatch(model.Email, @"^[a-z0-9._%+-]+\@([a-z0-9-]+\.)+[a-z]{2,4}$"))
{
throw new ArgumentNullException("Невалидная электронная почта клиента", nameof(model.Email));
throw new ArgumentNullException("Некорректно введен логин(почта) клиента", nameof(model.Email));
}
//if (string.IsNullOrEmpty(model.Password) || !Regex.IsMatch(model.Password, @"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$"))
if (string.IsNullOrEmpty(model.Password))
if (string.IsNullOrEmpty(model.Password) || !Regex.IsMatch(model.Password, @"^(?=.*[A-Za-z])(?=.*\d)(?=.*[^A-Za-z0-9\n]).{10,50}$"))
{
throw new ArgumentNullException("Слабый пароль", nameof(model.Password));
throw new ArgumentNullException("Некорректно введен пароль клиента", nameof(model.Password));
}
_logger.LogInformation("Client. Id: {id}, FIO: {fio}, email: {email}, password: {password}", model.Id, model.ClientFIO, model.Email,
model.Password);
var element = _clientStorage.GetElement(new ClientSearchModel

View File

@ -12,5 +12,5 @@
"PopHost": "pop.gmail.com",
"PopPort": "995",
"MailLogin": "@gmail.com",
"MailPassword": "emlb bzfd efdo uknu"
"MailPassword": "tjpc gejr uiyq qcvu"
}

View File

@ -6,6 +6,6 @@
<add key="PopHost" value="pop.gmail.com" />
<add key="PopPort" value="995" />
<add key="MailLogin" value="@gmail.com" />
<add key="MailPassword" value="emlb bzfd efdo uknu" />
<add key="MailPassword" value="tjpc gejr uiyq qcvu" />
</appSettings>
</configuration>