Last active
October 17, 2016 21:10
-
-
Save rkmax/b73232fba232796c04b99d2852c77bfb to your computer and use it in GitHub Desktop.
Crear sesion usando facebook
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
var fbGraph = require('fbgraph'); | |
var FACEBOOK_APP_ID = process.env.FACEBOOK_APP_ID; | |
var FACEBOOK_APP_SECRET = process.env.FACEBOOK_APP_SECRET; | |
function validateTokenAndGetProfile(token, cb) { | |
fbGraph.setAccessToken(token); | |
fbGraph.setAppSecret(FACEBOOK_APP_SECRET); | |
fbGraph.get('/me?fields=id,email,name,gender,bio,picture.type(large)', function(err, result) { | |
if (err) return cb(new Error(err.message)); | |
cb(null, result); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment