Thanks for the response. It brings my neurons into full activity at the start of my day.
I am surprised it is actually possible! I ended the day yesterday with everything configured in my initializers, by use'd in all.js.
this.use(passport.initialize());
this.use(passport.session());
Since if those lines are only in 01_passport.js I get this error, even though that initializer is definitely loaded:
Error: passport.initialize() middleware not in use
at IncomingMessage.req.login.req.logIn (<appdir>\node_modules\passport\lib\passport\http\request.js:30:30)
at Context.delegate.success (<appdir>\node_modules\passport\lib\passport\middleware\authenticate.js:194:13)
at Context.actions.success (<appdir>\node_modules\passport\lib\passport\context\http\actions.js:21:25)
at verified (<appdir>\node_modules\passport-facebook\node_modules\passport-oauth2\lib\strategy.js:181:18)
at Strategy._verify (<appdir>\config\initializers\01_passport.js:32:4)
at <appdir>\node_modules\passport-facebook\node_modules\passport-oauth2\lib\strategy.js:197:22
at <appdir>\node_modules\passport-facebook\lib\strategy.js:183:5
at passBackControl (<appdir>\node_modules\passport-facebook\node_modules\passport-oauth2\node_modules\oauth\lib\oauth2.js:107:9)
at IncomingMessage.<anonymous> (<appdir>\node_modules\passport-facebook\node_modules\passport-oauth2\node_modules\oauth\lib\oauth2.js:124:7)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
I'm probably not understanding properly how to set up my initializer as middleware. I also created a config/middlewares dir for these files. How would you call the init functions on those middlewares after the initializers finish?
I hope my new-to-the-game questions aren't annoying you too much! Thanks for the help.