Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

passportjs serializeuser

passport.serializeUser(function(user, done) {
  done(null, user.id);
});

passport.deserializeUser(function(id, done) {
  User.findById(id, function(err, user) {
    done(err, user);
  });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #passportjs #serializeuser
ADD COMMENT
Topic
Name
2+1 =