Bird
0
0

Which method must be implemented in a NestJS JwtStrategy class to validate the JWT payload?

easy📝 Syntax Q3 of 15
NestJS - Authentication
Which method must be implemented in a NestJS JwtStrategy class to validate the JWT payload?
Avalidate()
Bauthenticate()
Cauthorize()
Dverify()
Step-by-Step Solution
Solution:
  1. Step 1: Recall Passport strategy method

    Passport JWT strategy requires a validate() method to check the token payload.
  2. Step 2: Exclude other method names

    Methods like authenticate(), authorize(), or verify() are not standard in NestJS JwtStrategy.
  3. Final Answer:

    validate() -> Option A
  4. Quick Check:

    JWT strategy method = validate() [OK]
Quick Trick: Implement validate() to check JWT payload in strategy [OK]
Common Mistakes:
  • Using authenticate() instead of validate()
  • Confusing with other method names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes