public ActionResult Login(LoginModel model, string returnUrl) { var myAuthenticator = new Web.Models.Authenticate(); if (ModelState.IsValid && myAuthenticator.IsAuthenticated(model.UserName,model.Password)) { Session["User"] = model.UserName.Split('@')[0]; return RedirectToLocal(returnUrl); } ModelState.AddModelError("", "The user name or password provided is incorrect."); return View(model); }
public ActionResult Login(LoginModel model, string returnUrl) { var myAuthenticator = new Web.Models.Authenticate(); if (ModelState.IsValid && myAuthenticator.IsAuthenticated(model.UserName, model.Password)) { Session["User"] = model.UserName.Split('@')[0]; return(RedirectToLocal(returnUrl)); } ModelState.AddModelError("", "The user name or password provided is incorrect."); return(View(model)); }