Created
December 19, 2015 20:56
-
-
Save yamikuronue/ca7b9518e182c945831e to your computer and use it in GitHub Desktop.
Facebook authentication
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
app.get('/', function (req, res) { | |
request('https://graph.facebook.com/v2.5/oauth/access_token?client_id=[redacted]&client_secret=[redacted]&grant_type=client_credentials', function (error, response, body) { | |
body = JSON.parse(body); | |
if (!error && response.statusCode == 200) { | |
res.render('home', {access_token: body.access_token, temp: 'hello world'}); | |
} | |
}) | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment