Skip to content

Instantly share code, notes, and snippets.

@mickhansen
Created January 19, 2014 20:12
Show Gist options
  • Save mickhansen/8510386 to your computer and use it in GitHub Desktop.
Save mickhansen/8510386 to your computer and use it in GitHub Desktop.
passport.serializeUser(function(user, done) {
done(null, user.id);
});
passport.deserializeUser(function(id, done) {
models.User.find(id).done(function (err, user) {
done(err, user);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment