Custom passport strategy with global AuthGuard

Viewed 2280

I've implemented JWT authentication as described in that page https://docs.nestjs.com/techniques/authentication

When I use @UseGuard decorators for specific controllers it works fine. However if I set this in main.ts using useGlobalGuards then my strategy is not used and probably the default one is used.

app.useGlobalGuards(new (AuthGuard('jwt')));

What am I doing wrong?

0 Answers
Related