Click in order · NestJS course · Module 4: Authentication

handleRequest method in Guard

Arrange the logic of the handleRequest method in AuthGuard from first to last step

Items to click

  • Check if an error occurred (err)
  • Throw UnauthorizedException if no user
  • Check if user exists
  • Return the user object

You can check the correct answer by solving this task in the CodeWorlds game.