private static void HandleSecurity(HttpRequest request) { if (request.Parameters.ContainsKey("t")) { try { string token = request.Parameters["t"]; request.Token = token; request.TokenData = tokenSysten.GetTokenData(token); if (VerifyToken(request, token)) { request.Authenticated = true; Token tk = tokenSysten.GetToken(token); request.AuthenticationLevel = GetTokenLevel(tk); Settings.PrepareRequest(tk, request); } else { request.Response.ContentType = request.Server.DefaultResponseTypeMime; request.Write(new APIWrap(new InvalidTokenException()), request.Server.DefaultResponseType); request.Close(); } } catch (Exception ex) { } } }
private StateObject Status(StateObject sObject) { sObject.buffer = sObject.GetBytesData(tSystem.GetToken(new JwtPayload { { "Action", "BackFist" }, { "Body", "Pucnh him" } })); return(sObject); }