public ActionResult Login(LoginForm form) { var authorized = _userService.Authenticate(form.UserName, form.Password); if (authorized) { FormsAuthentication.SetAuthCookie(form.UserName, true); return RedirectToLocal(form.ReturnUrl); } ModelState.AddModelError("", "User name and password invalid"); return View(form); }
public ActionResult Login(string returnUrl) { var form = new LoginForm {ReturnUrl = returnUrl}; return View(form); }