Example #1
0
        public string Get(LogoutUser request, IHttpRequest req)
        {
            var token = req.Headers.Get("Authorization");

            TokenBusinessLogic.DeleteToken(token);
            return("logged out");
        }
Example #2
0
        public OperationResponse <bool> Get(LogoutUser request)
        {
            OperationResponse <bool> result = new OperationResponse <bool>();

            try
            {
                var token = HttpContext.Current.Request.Headers.Get("Authorization");
                TokenBusinessLogic.DeleteToken(token);
                result.OnSuccess(true, "logged out");
                return(result);
            }
            catch (Exception e)
            {
                Log.Error(e.Message + " " + e.StackTrace);
                result.OnException("token deletion failed");
                return(result);
            }
        }