📅  最后修改于: 2022-03-11 15:00:43.307000             🧑  作者: Mango
// requires the model with Passport-Local Mongoose plugged in
const User = require('./models/user');
// use static authenticate method of model in LocalStrategy
passport.use(new LocalStrategy(User.authenticate()));
// use static serialize and deserialize of model for passport session support
passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());