//[EnableCors(origins: "*", headers: "*", methods: "*")] public HttpResponseMessage UpdateCookie() { SSOReturnResult ret = new SSOReturnResult(); SSOUserStatus us = new SSOUserStatus(); string req = SSOHTTPRequestService.getDataInRequest(Request); SSOCookieInfor ci = SSOHTTPRequestService.getDataFromString <SSOCookieInfor>(req); SSOUserLoginInfors oldValue = null; if (ci != null && ci.Token != null && UserManagerService.CheckRequestAuthentication(ci.Token, out oldValue)) { oldValue.UserCookie.Expires = ci.Expires; UserManagerService.UsersLoggedIn.AddOrUpdate(ci.Token, oldValue, (key, existingVal) => { existingVal.UserCookie.Expires = oldValue.UserCookie.Expires; return(existingVal); }); ret.ReturnCode = HttpStatusCode.OK; ret.Message = "Cập nhật thành công"; } else { ret.ReturnCode = HttpStatusCode.BadRequest; ret.Message = "Dữ liệu cập nhật không hợp lệ"; } return(SSOHTTPRequestService.CreateResponseMessage(ret, HttpStatusCode.OK)); }
//[EnableCors(origins: "*", headers: "*", methods: "*")] public HttpResponseMessage getUserStatus() { SSOUserStatus us = new SSOUserStatus(); SSOUserLoginInfors Us = null; string req = SSOHTTPRequestService.getDataInRequest(Request); string dt = SSOHTTPRequestService.getDataFromString <string>(req); us.UserLoggedIn = UserManagerService.CheckRequestAuthentication(dt, out Us); return(SSOHTTPRequestService.CreateResponseMessage(us, HttpStatusCode.OK)); }