public ActionResult Login(LoginModel model, string returnUrl) { if (ModelState.IsValid) { var authService = AppHostBase.Resolve<AuthService>(); authService.RequestContext = System.Web.HttpContext.Current.ToRequestContext(); var response = authService.Authenticate(new Auth { UserName = model.Email, Password = model.Password, RememberMe = model.RememberMe }); return RedirectToLocal(returnUrl); } // If we got this far, something failed, redisplay form ModelState.AddModelError("", "The user name or password provided is incorrect."); return View(model); }
public ActionResult Login(string returnUrl) { var model = new LoginModel(); ViewBag.ReturnUrl = returnUrl; return View(model); }