Put in order · NestJS course · Module 2: Routing and Request Lifecycle
Components of the Composite @Auth() Decorator
Order the lines of the @Auth() decorator from the lesson from top to bottom:
Items to put in order
- ApiBearerAuth()
- UseGuards(JwtAuthGuard, RolesGuard)
- SetMetadata('roles', roles)
- applyDecorators(...)
Show the answer
Correct order:
- applyDecorators(...)
- UseGuards(JwtAuthGuard, RolesGuard)
- SetMetadata('roles', roles)
- ApiBearerAuth()