strongloop / loopback-component-oauth2

oAuth 2.0 server for LoopBack
http://www.strongloop.com
Other
62 stars 63 forks source link

passport initialisation optional #79

Closed peterwillis closed 4 years ago

peterwillis commented 6 years ago

Description

Passport is designed to be modular, it's better not to assume loopback-component-oauth2 will be initializing it unless you are giving it it's own instance using new passport.Passport(). This modification means you can pass in an existing passport that is assumed to be initialized, and then also export it so it can be modified. I know that passport is a singleton, but if you call initialize twice you can end up with bugs because there could be two instances flying around.

I have signed the CLA and the message is under 50 characters this time :-)

Related issues

Checklist

slnode commented 6 years ago

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

dhmlau commented 6 years ago

@slnode test please

dhmlau commented 6 years ago

@strongloop/sq-lb-apex @bajtos , the PR sounds reasonable to me. May I get another review please?

bajtos commented 6 years ago

I am not familiar with this code base at all. @raymondfeng could you please take a look?

peterwillis commented 6 years ago

I would like to add the tests, but oauth2-loopback.js has not been written in a way that makes it testable without mocking all of loopback. There are no tests for that file in the project at all at the moment.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.