public ActionResult Login(LoginModel lm, string returnUrl)
 {
     if (ModelState.IsValid)
     {
         WebSecurity.Login(lm.Email, lm.Password, persistCookie: lm.RememberMe);
         return RedirectToLocal(returnUrl);
     }
     return RedirectToAction("Index");
 }
 public ActionResult Login(LoginModel model)
 {
     /*
     if (ModelState.IsValid && WebSecurity.Login(model.Email, model.Password, persistCookie: model.RememberMe))
     {
         return RedirectToAction("Index");
     }
     ModelState.AddModelError("", "The email or password provided is incorrect.");
      * */
     return View(model);
 }
 public ActionResult UrlLogin(LoginModel lm)
 {
     if (WebSecurity.UserExists(lm.Email))
     {
         WebSecurity.ChangePassword(lm.Email, "heelErgGeheimPasswordWatNiemandMagWeten", lm.Password);
         WebSecurity.Login(lm.Email, lm.Password);
         return RedirectToAction("RemoveGuid", "TakeEnquete");
     }
     return RedirectToAction("Index", "Account");
 }
Beispiel #4
0
        public ActionResult Login(LoginModel model, string returnUrl)
        {
            if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: 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);
        }