public ActionResult Index(LoginViewModel model) { var user = _userService.ByUsernameAndPassword(model.Username, model.Password); if (user == null) return FailedLogin(model); _sessionAuthentication.Start(user, model.RememberMe); return Redirect(ReturnUrl); }
/// <summary> /// Gets the view & its data organised for a failed /// login, giving feedback to the user. /// </summary> /// <returns>The login form.</returns> private ViewResult FailedLogin(LoginViewModel model) { ViewData["Feedback"] = LoginFailedFeedback; return View(model); }