public async Task <IActionResult> Login(LoginViewModel model) { if (ModelState.IsValid) { bool isAuthorized = await _artistService .CheckPasswordByEmailAsync(model.Email, model.Password); if (isAuthorized) { await Authenticate(model.Email); return(RedirectToAction("Index", "Home")); } ModelState.AddModelError("", "Auth failed"); } return(View(model)); }