Example #1
0
        public ActionResult <List <Snippet> > GetSharedUserSnippets([FromHeader] string Authorization)
        {
            string tokenString = Authorization.Split(' ')[1];
            var    handler     = new JwtSecurityTokenHandler();
            var    token       = handler.ReadJwtToken(tokenString) as JwtSecurityToken;
            var    email       = token.Claims.First(claim => claim.Type == ClaimTypes.Email).Value;

            return(_snippetService.GetSharedUserSnippets(email));
        }