регистрация работает
This commit is contained in:
parent
f6c5157c5d
commit
ffe3f57242
@ -21,13 +21,13 @@ namespace HardwareShopRestApi.Controllers
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public UserViewModel? Login(string login, string password)
|
||||
public UserViewModel? Login(string email, string password)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _logic.ReadElement(new UserSearchModel
|
||||
{
|
||||
Email = login,
|
||||
Email = email,
|
||||
Password = password
|
||||
});
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace HardwareShopWorkerApp.Controllers
|
||||
{
|
||||
throw new Exception("Введите логин, email, пароль");
|
||||
}
|
||||
APIClient.PostRequest("api/client/register", new UserBindingModel
|
||||
APIClient.PostRequest("api/user/register", new UserBindingModel
|
||||
{
|
||||
Login = login,
|
||||
Email = email,
|
||||
@ -67,6 +67,11 @@ namespace HardwareShopWorkerApp.Controllers
|
||||
{
|
||||
throw new Exception("Введите почту и пароль");
|
||||
}
|
||||
APIClient.User = APIClient.GetRequest<UserViewModel>($"api/user/login?email={email}&password={password}");
|
||||
if (APIClient.User == null)
|
||||
{
|
||||
throw new Exception("Неверные почта и/или пароль");
|
||||
}
|
||||
Response.Redirect("MainWorker");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user