docs.nestjs.com icon indicating copy to clipboard operation
docs.nestjs.com copied to clipboard

Implement AbstractStrategy in https://docs.nestjs.com/security/authentication#implementing-passport-local ?

Open DevDengChao opened this issue 3 years ago • 0 comments

I'm submitting a...

  • [ ] Regression
  • [ ] Bug report
  • [ ] Feature request
  • [x] Documentation issue or request (new chapter/page)
  • [ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

As https://docs.nestjs.com/security/authentication#implementing-passport-strategies and https://docs.nestjs.com/security/authentication#implementing-passport-local says, you need to implement a validate(args[]) function yourself for a subclass of PassportStrategy, but the IDE will consider validated(args[]) unused.

image

Expected behavior

Maybe we should encourage users to implement AbstractStrategy from @nestjs/passport to get better editing experience.

image

Minimal reproduction of the problem with instructions

As the screenshot.

What is the motivation / use case for changing the behavior?

For better editing experience, and IDE will promot user to implement validate(args[]).

Environment

For Tooling issues:

  • Node version: not related
  • Platform: not related

Others:

It will be better if we could let PassportStrategy implement AbstractStrategy.

DevDengChao avatar Sep 07 '22 06:09 DevDengChao