Skip to content

Instantly share code, notes, and snippets.

@woloski
Created Feb 4, 2014
Embed
What would you like to do?
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