0

I'm facing this problem with compound passport. I've already followed the steps from the guide but I cannot get this working when I try to access /auth/github.

Any tips?

GET /auth/github controller: auth action: github
Params: {"controller":"auth","action":"github"}
>>>  perform github
Error: Undefined action auth#github(/auth/github)
at Object.FlowControl.call.context.innerNext (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:67:27)
at Array.FlowControl.call.collection.forEach.queue.push.ctl.context.inAction [as 1] (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:139:28)
at run (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:102:27)
at Array.FlowControl.call.action [as 0] (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:60:13)
at run (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:102:27)
at FlowControl.call.compiledAction.(anonymous function) (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:90:9)
at Controller.call (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:49:16)
at Controller.call (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:93:10)
at Controller.perform (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/node_modules/kontroller/lib/flow-control.js:18:10)
at ControllerBrigde.callControllerAction (/Users/javiermanzanomorilla/Development/workspace/authapp/node_modules/compound/lib/controller-bridge.js:95:9)
laggingreflex
  • 32,948
  • 35
  • 141
  • 196
Javier Manzano
  • 4,761
  • 16
  • 56
  • 86

1 Answers1

0

i think that you havn't init the passport.

if you are using compound-passport you have to initialize it by calling the init function in config/environment.

    var pass_connect=require('compound-passport');
     app.configure(function(){
     ....

   //init the compound passport
    pass_connect.init(compound);

    app.use(app.router);
 });

case if you want to initialize it manualy you have to call those two methods :

 var passport=require('passport');    
 var Strategy = require('passport-github').Strategy;
    passport.use(new Strategy({
    clientID: conf.github.clientID,
    clientSecret: conf.github.secret,
    callbackURL: conf.baseURL + 'auth/github/callback'
}, exports.callback));

app.get('/auth/github',
    passport.authenticate('github'));
app.get('/auth/github/callback',
    passport.authenticate('github', { failureRedirect: '/' }),
    exports.redirectOnSuccess);

sorry for my english.

Sam_al
  • 1
  • 1