示例#1
0
        public IActionResult List()
        {
            // UserClaims.UserId, get all refresh tokens, return them
            var subject = User.Claims.FirstOrDefault(c => c.Type == "sub");

            if (subject == null)
            {
                throw new Exception("subject not found");
            }
            var tokens = _refreshTokenRepository
                         .FindForUser(subject.Value)
                         .Select(x => new RefreshTokenResponse()
            {
                Token = x.Value
            });

            return(Ok(tokens));
        }