NestJS · Junior · Question 39 of 75

What is the job of a guard?

Explanation

A guard implements canActivate() and returns true or false (or throws). Returning false gives 403 Forbidden by default.

Further reading

Problem with a question

NestJS · Junior · question 39

Test yourself

Take the NestJS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz