Skip to content

Instantly share code, notes, and snippets.

@tarlepp
Last active August 29, 2015 14:22
Show Gist options
  • Save tarlepp/57cf0cb17725dde304b8 to your computer and use it in GitHub Desktop.
Save tarlepp/57cf0cb17725dde304b8 to your computer and use it in GitHub Desktop.
passport.serializeUser(function (user, next) {
next(null, user.id);
});
passport.deserializeUser(function (id, next) {
sails.models.user.findOne(id)
.populate('products')
.exec(next);
});
module.exports = passport;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment