// Configure Passport authenticated session persistence. // // In order to restore authentication state across HTTP requests, Passport needs // to serialize users into and deserialize users out of the session. The // typical implementation of this is as simple as supplying the user ID when // serializing, and querying the user record by ID from the database when // deserializing. passport.serializeUser((user, cb) => { cb(null, user.id); });
// Configure Passport authenticated session persistence. // // In order to restore authentication state across HTTP requests, Passport needs // to serialize users into and deserialize users out of the session. In a // production-quality application, this would typically be as simple as // supplying the user ID when serializing, and querying the user record by ID // from the database when deserializing. However, due to the fact that this // example does not have a database, the complete user profile is serialized // and deserialized. passport.serializeUser(function(user, cb) { cb(null, user); });
// Configure Passport authenticated session persistence. // // In order to restore authentication state across HTTP requests, Passport needs // to serialize users into and deserialize users out of the session. The // typical implementation of this is as simple as supplying the user ID when // serializing, and querying the user record by ID from the database when // deserializing. passport.serializeUser(function(user, cb) { cb(null, user.id); });
// Configure Passport authenticated session persistence. // // In order to restore authentication state across HTTP requests, Passport needs // to serialize users into and deserialize users out of the session. The // typical implementation of this is as simple as supplying the user ID when // serializing, and querying the user record by ID from the database when // deserializing. passport.serializeUser(function(user, cb) { cb(null, user.id); });
// In order to help keep authentication state across HTTP requests, // Sequelize needs to serialize and deserialize the user // Just consider this part boilerplate needed to make it all work passport.serializeUser(function(user, cb) { cb(null, user); });
// In order to help keep authentication state across HTTP requests, // Sequelize needs to serialize and deserialize the user // Just consider this part boilerplate needed to make it all work passport.serializeUser(function(user, cb) { cb(null, user); });