Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 30, 2018 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/37650b2fcc633b923ba7cf15ca70eee3 to your computer and use it in GitHub Desktop.
Save amandeepmittal/37650b2fcc633b923ba7cf15ca70eee3 to your computer and use it in GitHub Desktop.
passport.serializeUser(function(user, done) {
done(null, user.id);
});
passport.deserializeUser(function(id, done) {
User.findById(id, function(err, user) {
done(err, user);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment