public async Task <IActionResult> Login(LoginViewModel viewModel) { if (!this.ModelState.IsValid) { return(View(viewModel)); } try { var user = _accountManager.Find(viewModel.Username, viewModel.Password); _accountManager.CheckStatus(user); await SignInUserAsync(user); return(BackToHome()); } catch (Exception ex) { TempData["Status"] = ex.Message; return(View(viewModel)); } }