angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Error: OAuthStrategy requires session support #406

Closed sethlesky closed 10 years ago

sethlesky commented 10 years ago

Using the latest generator (2.0.7), I'm getting the following error when attempting to signup/login with twitter. This occurs after updating an existing project that had oauth working, and when generating a new project.

Error: OAuthStrategy requires session support. Did you forget app.use(express.session(...))? at Strategy.OAuthStrategy.authenticate (/Users/sethlesky/code/dopcast/app-update/node_modules/passport-twitter/node_modules/passport-oauth1/lib/strategy.js:120:41) at Strategy.authenticate (/Users/sethlesky/code/dopcast/app-update/node_modules/passport-twitter/lib/strategy.js:85:40) at attempt (/Users/sethlesky/code/dopcast/app-update/node_modules/passport/lib/middleware/authenticate.js:337:16) at Object.authenticate [as handle] (/Users/sethlesky/code/dopcast/app-update/node_modules/passport/lib/middleware/authenticate.js:338:7) at next_layer (/Users/sethlesky/code/dopcast/app-update/node_modules/express/lib/router/route.js:103:13) at Route.dispatch (/Users/sethlesky/code/dopcast/app-update/node_modules/express/lib/router/route.js:107:5) at c (/Users/sethlesky/code/dopcast/app-update/node_modules/express/lib/router/index.js:195:24) at Function.proto.process_params (/Users/sethlesky/code/dopcast/app-update/node_modules/express/lib/router/index.js:251:12) at next (/Users/sethlesky/code/dopcast/app-update/node_modules/express/lib/router/index.js:189:19) at Function.proto.handle (/Users/sethlesky/code/dopcast/app-update/node_modules/express/lib/router/index.js:234:5)
sethlesky commented 10 years ago

My .yo-rc.json:

{
  "generator-angular-fullstack": {
    "insertRoutes": true,
    "registerRoutesFile": "server/routes.js",
    "routesNeedle": "// Insert routes below",
    "routesBase": "/api/",
    "pluralizeRoutes": true,
    "insertSockets": true,
    "registerSocketsFile": "server/config/socketio.js",
    "socketsNeedle": "// Insert sockets below",
    "filters": {
      "js": true,
      "html": true,
      "less": true,
      "ngroute": true,
      "bootstrap": true,
      "uibootstrap": true,
      "socketio": true,
      "mongoose": true,
      "auth": true,
      "oauth": true,
      "googleAuth": true,
      "facebookAuth": true,
      "twitterAuth": true
    }
  },
  "generator-ng-component": {
    "routeDirectory": "client/app/",
    "directiveDirectory": "client/app/",
    "filterDirectory": "client/app/",
    "serviceDirectory": "client/app/",
    "basePath": "client",
    "filters": [
      "ngroute"
    ],
    "extensions": [
      "js",
      "html",
      "less"
    ]
  }
}
DaftMonk commented 10 years ago

Reverted a change in 2.0.8 to fix this