Imprimir dados de profile do Facebook com Passport
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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