I'm trying to implement an api for my android app which uses FB for authentication. I'm trying to use passport-facebook-token but I get this error when I make a new FacebookTokenStrategy:
passport.use('facebook-token', ^new FacebookTokenStrategy({ TypeError: object is not a function
here is my code:
var passport = require('passport');
var FacebookTokenStrategy= require('passport-facebook-token');
passport.use('facebook-token',new FacebookTokenStrategy({
clientID: "xxxxxxxxxx",
clientSecret: "xxxxxxxxxxxxxxxxxxxx"
},
function(accessToken, refreshToken, profile, done) {
users.findOrCreate({ facebookId: profile.id }, function (err, user) {
return done(err, user);
});
}
));
I had to change:
to: