Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Imprimir dados de profile do Facebook com Passport
//http://passportjs.org/guide/facebook/
var passport = require('passport')
, FacebookStrategy = require('passport-facebook').Strategy;
passport.use(new FacebookStrategy({
clientID: FACEBOOK_APP_ID,
clientSecret: FACEBOOK_APP_SECRET,
callbackURL: "http://www.example.com/auth/facebook/callback"
},
function(accessToken, refreshToken, profile, done) {
console.log(profile); //Imprimir dados do profile
User.findOrCreate(..., function(err, user) {
if (err) { return done(err); }
done(null, user);
});
}
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment