Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Get()
- @UseGuards(AuthGuard('jwt'))
- async findAll(): Promise<UserDto[]> {
- return this.userService.findAll();
- }
- async createToken() {
- const user: UserDto = { name: 'shamnad', phoneNumber: '12435' };
- return jwt.sign(user, 'secretkey'); // <== /! focus on this one /!
- }
- async createToken() {
- const user: UserDto = { name: 'shamnad', phoneNumber: '12435' };
- return jwt.sign(user, 'secretKey'); // <== /! focus on this one /!
- }
- constructor(private readonly authService: AuthService) {
- super({
- jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
- secretOrKey: 'secretKey', // <== /! focus on this line /!
- });
- }
Add Comment
Please, Sign In to add comment