Пример #1
0
        public string Get(int id)
        {
            var user     = HttpContext.User;
            var headers  = _httpContextAccessor.HttpContext.Request.Headers;
            var tokenStr = headers["Authorization"].ToString();

            if (string.IsNullOrEmpty(tokenStr) && tokenStr.StartsWith("Bearer"))
            {
                string token = tokenStr.Substring("Bearer ".Length).Trim();
                var    auth  = _authService.DecodeToken(token);
            }

            return("value");
        }