private bool IsValid(UserModel user) { if (user.Password != "guest" || user.UserName != "guestpro") return false; return true; }
// // GET: /Account/ public ActionResult LogOn(UserModel user) { if (!IsValid(user)) { this.Response.Clear(); return Json(false); } else { AuthUser(user); return Json(true); } }
private void AuthUser(UserModel user) { IAuthenticator authenticator = new CookieAuthenticator(); authenticator.SetCookie(user.UserName, true); }