Exemplo n.º 1
0
        private JWT GenerateJWT(UserAuthDto user)
        {
            var userModel = _userService.GetAll().First(dto => dto.Username == user.UserName);

            var jwt = _tokenHandler.CreateJwt(userModel.Role.Name, user.UserName, userModel.UserId,
                                              userModel.SecurityStamp);

            PassTokenToDb(jwt.RefreshToken, userModel);

            return(jwt);
        }