I'm making a node app, and when I try to use passport with Facebook, The verify callback doesn't run(nothing is logged). Any help would be appreciated.
var express = require('express');
var routes = require('./routes/routes.js');
var layout = require('./routes/layout.js');
var facebook = require('./routes/facebook.js');
var editprof = require('./routes/editprof.js');
var app = express();
var vogels = require('vogels');
var passport = require('passport');
var FacebookStrategy = require('passport-facebook').Strategy;
var configAuth = require('./config/auth');
app.use(passport.initialize());
app.use(passport.session());
...
passport.use(new FacebookStrategy({
// pull in our app id and secret from our auth.js file
clientID : configAuth.facebookAuth.clientID,
clientSecret : configAuth.facebookAuth.clientSecret,
callbackURL : 'http://localhost:8080/auth/facebook/callback'
},
// facebook will send back the token and profile
function(token, refreshToken, profile, done) {
console.log("TOKEN",token);
// asynchronous
process.nextTick(function() {
console.log("TOKEN",token);
console.log("ID", profile.id);
return done(null, profile);
});
}));
...
app.get('/auth/facebook', passport.authenticate('facebook'));
app.get('/auth/facebook/callback', facebook.callback);