Skip to content

Instantly share code, notes, and snippets.

@woloski
Created February 4, 2014 14:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woloski/8804382 to your computer and use it in GitHub Desktop.
Save woloski/8804382 to your computer and use it in GitHub Desktop.
jwt and social auth
app.get('/auth/facebook/callback',
passport.authenticate('facebook', { failureRedirect: '/error', session: false }),
function(req, res) {
var token = jwt.sign(req.user, secret, { expiresInMinutes: 60*5 });
res.redirect('/#jwt=' + jwt);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment