passport local mongoose npm code example
Example 1: passport local mongoose
const User = require('./models/user');
passport.use(User.createStrategy());
passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());
Example 2: npm passport-local-mongoose
require('dotenv').config()
Example 3: passport local mongoose
const User = require('./models/user');
passport.use(new LocalStrategy(User.authenticate()));
passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());