blitz
blitz copied to clipboard
Toolkit: Auth - Passport - Custom strategy name
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
assertto check if there is a strategy with the given name - Update the
passport.usecall and pass the strategy name as first argument
(passport.use(<name>, <strategy)instead ofpassport.use(<strategy>)) - Update documentation
Additional context
If you want, I can provide a PR with the changes