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:

  1. applyDecorators(...)
  2. UseGuards(JwtAuthGuard, RolesGuard)
  3. SetMetadata('roles', roles)
  4. ApiBearerAuth()