Beispiel #1
0
 public ActionResult AjaxLogin(LoginView loginView)
 {
     if (ModelState.IsValid)
     {
         var user = Auth.Login(loginView.Email, loginView.Password, loginView.IsPersistent);
         if (user != null)
         {
             return View("_Ok");
         }
         ModelState["Password"].Errors.Add("Пароли не совпадают");
     }
     return View(loginView);
 }
Beispiel #2
0
 public ActionResult Login(LoginView loginView)
 {
     if (ModelState.IsValid)
     {
         var user = Auth.Login(loginView.Email, loginView.Password, loginView.IsPersistent);
         if (user != null)
         {
             return RedirectToAction("Index", "Home");
         }
         ModelState["Password"].Errors.Add("Логин или пароль не верный");
     }
     return View(loginView);
 }