Skip to content

Instantly share code, notes, and snippets.

@dnzrx
Created December 3, 2015 10:02
Show Gist options
  • Save dnzrx/b389a1f25bebeeebe0c4 to your computer and use it in GitHub Desktop.
Save dnzrx/b389a1f25bebeeebe0c4 to your computer and use it in GitHub Desktop.
//Route - index.js
//ini routing - routing yang harus ditambahkan untuk memakai passport facebook
router.get('/auth/facebook', passport.authenticate('facebook', { scope: ['email'] }));
router.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/login' }), function (req, res) {
req.session.user = req.user;
return res.json(req.session.user);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment