I'm trying to configure passport-twitter in my locomotive project.
The problem is that nothing happens after hitting the /auth/twitter url.
Edit: I hit the controller but twitter seems to not be invoked.
What I did was set a match to /auth/twitter at routes.js and mapped this to an auth_controller.js
Something like the code below:
routes.js
this.match('auth/twitter/', 'auth#twitter'); this.match('auth/twitter/callback/', 'auth#callback');
auth_controller.js
var locomotive = require('locomotive') , Controller = locomotive.Controller , passport = require('passport'); var AuthController = new Controller(); AuthController.twitter = function() { console.log('[##] AuthController.twitter [##]'); passport.authenticate('twitter'), function(req, res) {}; } AuthController.callback = function() { console.log('[##] AuthController.callback [##]'); passport.authenticate('twitter', { failureRedirect: '/show' }), function(req, res) { res.redirect('/list'); }; } module.exports = AuthController;
I really don't know if that's the right way to use it with locomotive, any help will be very appreciated.
Cheers, Fabio