NestJS · Junior · Question 52 of 75
How is JWT authentication often implemented in Nest?
- ✓Correct answer: With
@nestjs/jwtto sign and verify tokens and a guard that checks theAuthorizationheader (optionally via Passport) - 2By storing passwords in the token
- 3Nest has no way to work with JWT
Explanation
The guard verifies the token and attaches the user to request.user; a custom @User() decorator can read it in handlers.