lucj/sails-oauth2-api

Migrate to Sails 0.11

Closed this issue · 5 comments

I've found that this code base is out of date. I've been trying to migrate it to Sails 0.11, with some success but when moving the customMiddleware into the http.js file, passport is not yet available and cannot be initialized.

I end up with

C:\Users\mwilliams\Documents\Buzztime\SailsPhoton\config\http.js:94 app.use(passport.initialize()); ^ ReferenceError: passport is not defined at Object.module.exports.http.customMiddleware (C:\Users\mwilliams\Documents\Buzztime\SailsPhoton\config\http.js:94:13) at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\lib\hooks\http\middleware\load.js:24:25 at Function.forEach (C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\lodash\dist\lodash.js:3297:15 ) at builtInMiddlewareLoader (C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\lib\hooks\http\middleware\load.js:1 9:5) at loadExpress (C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\lib\hooks\http\initialize.js:104:9) at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\lib\hooks\http\index.js:191:18 at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\lib\app\private\after.js:91:14 at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:254:17 at done (C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:135:19) at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:32:16 at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:251:21 at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:575:34 at handlerFn (C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\lib\app\private\after.js:78:13) at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:570:21 at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:249:17 at C:\Users\mwilliams\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:125:13

lucj commented

Thanks for the feedback, I'll test sails 0.11 soon.

Hey, I have a similar system to build and I'm looking for a codebase. It should be opensource and I could therefore hopefully become a fork contributer :)
Were you able to get it running on SailsJS 0.11?

lucj commented

Hello,
I've release a version with sails 0.11, it's in the feature/sails-0.11 branch.
Feel free to test :)

lucj commented

Migrated to sails 0.11. Merged to develop branch.

I confirm it does work properly btw.
Thanks for the work!! :)