public JsonResult Login(UserApp user, string password) { UserApp thisUser = UserManagerApp.Find(user.Email, password); if (thisUser != null) { ClaimsIdentity Ident = UserManagerApp.CreateIdentity(thisUser, DefaultAuthenticationTypes.ApplicationCookie); HttpContext.GetOwinContext().Authentication.SignOut(); HttpContext.GetOwinContext().Authentication.SignIn(new AuthenticationProperties() { IsPersistent = false }, Ident); return(Json(new { status = "ok" })); } else { return(Json(new { status = "error" })); } }
public void TestFind() { var user = _app.Find(21); Console.WriteLine(user.Name); }
public ActionResult Add(int id = 0) { return(View(_app.Find(id))); }