public async Task <IActionResult> Authorize(AuthorizationModel model) { var user = await _usersService.Authorize(model.Username, model.Password); if (user == null) { ModelState.AddModelError("", "Неверные имя пользователя или пароль"); return(View("Index")); } await _signInManager.SignInAsync(user, true); return(RedirectToAction("Index", "Products")); }