Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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
4+3 =