NestJS - AuthenticationWhich method must be implemented in a NestJS JwtStrategy class to validate the JWT payload?Avalidate()Bauthenticate()Cauthorize()Dverify()Check Answer
Step-by-Step SolutionSolution:Step 1: Recall Passport strategy methodPassport JWT strategy requires a validate() method to check the token payload.Step 2: Exclude other method namesMethods like authenticate(), authorize(), or verify() are not standard in NestJS JwtStrategy.Final Answer:validate() -> Option AQuick 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
Master "Authentication" in NestJS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More NestJS Quizzes Authentication - Token generation and validation - Quiz 2easy Authentication - Session-based authentication - Quiz 4medium Guards - Combining multiple guards - Quiz 11easy Interceptors - Cache interceptor - Quiz 13medium Interceptors - Timeout interceptor - Quiz 1easy Interceptors - Exception mapping interceptor - Quiz 6medium Middleware - Applying middleware to routes - Quiz 9hard Middleware - Functional middleware - Quiz 6medium Middleware - Third-party middleware (cors, helmet) - Quiz 6medium Pipes - Custom pipes - Quiz 8hard