NestJS · Junior · Question 53 of 75
How can you mark some routes as public when an auth guard is global?
- ✓Correct answer: Create a
@Public()decorator that sets metadata, and read it in the guard withReflectorto skip the check - 2Remove the guard from
main.tsfor each route - 3Put public routes in a separate Nest app
Explanation
Metadata plus Reflector is the standard way for guards and interceptors to read route-level settings.