blitz icon indicating copy to clipboard operation
blitz copied to clipboard

Toolkit: Auth - Passport - Custom strategy name

Open noxify opened this issue 3 years ago • 0 comments

What do you want and why?

While trying to implement the third party login via passportjs I have currently the challenge to change the strategy name.

There are some providers which have a static strategy name ( e.g. twitter ) and there are some providers ( in my case https://github.com/panva/node-openid-client ) which have a generic name ( e.g. the issuer hostname ).

It would be good to have an additional/optional property in the strategy definition to override the default strategy name.

Possible implementation(s)

Add a new optional property ( name or alias? ) to the definition to override the default strategy name.

What needs to be changed?

  • Update the type definition for BlitzPassportStrategy
  • Update the assert to check if there is a strategy with the given name
  • Update the passport.use call and pass the strategy name as first argument
    ( passport.use(<name>, <strategy) instead of passport.use(<strategy>))
  • Update documentation

Additional context

If you want, I can provide a PR with the changes

noxify avatar Aug 07 '22 11:08 noxify