public ActionResult Login(string returnUrl) { var model = new AccountLoginModel { ReturnUrl = returnUrl }; return View(model); }
public ActionResult Login(AccountLoginModel model) { var user = _userRepository.GetUser(model.Username); if (Membership.ValidateUser(model.Username, model.Password)) { LogInSiteUser(model.Username); if (!string.IsNullOrEmpty(model.ReturnUrl)) { return Redirect(model.ReturnUrl); } return RedirectToAction("Index", "Home"); } return RedirectToAction("Login"); }