public ActionResult Login(LoginModel model) { if (!ModelState.IsValid) return View(); var user = UserService.Authentificate(model.Email, model.Password); if (user == null) return RedirectToAction("Error", new { errorCase = ErrorCase.InvalidUserData }); return RedirectToAction("Courses", "Study"); }
public void AddAuthCookieToResponse(LoginModel model) { FormsAuthentication.SetAuthCookie(model.Id.ToString(), model.RememberMe); }