Bird
0
0

Which of the following is the correct way to register a Passport strategy in a NestJS module?

easy📝 Syntax Q3 of 15
NestJS - Authentication
Which of the following is the correct way to register a Passport strategy in a NestJS module?
Aproviders: [LocalStrategy]
Bimports: [LocalStrategy]
Ccontrollers: [LocalStrategy]
Dexports: [LocalStrategy]
Step-by-Step Solution
Solution:
  1. Step 1: Understand module registration

    Strategies are classes that must be provided as providers in NestJS modules.
  2. Step 2: Identify correct module property

    Providers array is for services and strategies.
  3. Final Answer:

    providers: [LocalStrategy] -> Option A
  4. Quick Check:

    Strategy registration = providers array [OK]
Quick Trick: Register strategies as providers, not imports or controllers [OK]
Common Mistakes:
  • Putting strategies in imports array
  • Adding strategies to controllers array
  • Using exports instead of providers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes