示例#1
0
        private IActionResult SendToken(UserDto user)
        {
            //TODO: move to user service
            var    claims        = new Claim[] { new Claim(ClaimTypes.Name, user.Id.ToString()) };
            string tokenString   = _jwtAuthManager.GenerateAccessToken(claims);
            var    userWithToken = new UserAuthResponse
            {
                Id       = user.Id,
                Username = user.Username,
                Token    = tokenString
            };

            return(Ok(userWithToken));
        }