public ActionResult Login(LoginViewModel loginViewModel, string redirectUrl) { if (!ModelState.IsValid) { return(View(loginViewModel)); } // This doesn't count login failures towards account lockout // To enable password failures to trigger account lockout, change to shouldLockout: true var result = _signInService.PasswordSignIn(loginViewModel); switch (result) { case SignInStatus.Success: return(RedirectToAction("Index", "Home")); case SignInStatus.LockedOut: return(View("_Lockout")); case SignInStatus.RequiresVerification: return(RedirectToAction("SendCode", new { ReturnUrl = redirectUrl, RememberMe = loginViewModel.RememberMe })); case SignInStatus.Failure: default: ModelState.AddModelError("", "Invalid login attempt."); return(View(loginViewModel)); } }