-
Notifications
You must be signed in to change notification settings - Fork 29
Initializing PassportJS #26
Comments
Since passport needs a bit more setup, take a peek at https://github.com/krakenjs/kraken-examples/blob/master/with.passport/config/config.json and particularly https://github.com/krakenjs/kraken-examples/blob/master/with.passport/lib/spec.js |
Are you receiving an error message? Can you post additional details? |
I have actually seen the KrakenJS passport example and how the code is put in there to initialize it with the event hooks but do not you think that is a bit anti-productive to the whole 'middleware in config' idea as that scatters the code a bit ? There is no way to do it purely using the config file ? Here is the error:
|
The vast majority of middleware is configured simply through a single call and these cases are handled. Passport's requirement to not only add middleware, but add strategies to passport itself make a purely configuration driven setup hard. This is just the situation that the middleware event hooks were designed for. |
@tlivings The strategies can be loaded on an event |
I don't see why not. |
@tlivings I made a two days ago a PR, to improve the problem with this issue, when someone will review the changes? |
Taking a look at that pr now! |
LGTM! |
Yep, as far as I can tell #29 solves this. |
Hey sorry @luizfilipe, I'll try to get this published today. Looking like it'll be meddleware@3.0 due to the breaking changes. |
Hi, I know it's been a while, but could you explain how this fix works with Passport? Thank you. |
My understanding was just that Passport internally depend on instance methods. Due to context not being set correctly the object instance upon which methods were being called was not the correct or expected one. |
I am trying but failing to register PassportJS middleware in the config file. Here is the config file code for meddleware:
What am I doing wrong ?
The text was updated successfully, but these errors were encountered: