public ActionResult Login(LoginModel model, string returnUrl) { if (ModelState.IsValid && ProfileHandler.ConfirmValidation(model.UserName) && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe)) { return(RedirectToLocal(returnUrl)); } // If we got this far, something failed, redisplay form ModelState.AddModelError("", "The email or password provided is incorrect."); return(View(model)); }