Closed wolfgang04 closed 2 years ago
Was just following and encountered this error. Tried searching google for solutions and can't find anything.
app.set("view engine", "ejs"); app.use(bodyParser.urlencoded({extended: true})); app.use(session({ secret: "mysecret.", resave: false, saveUninitialized: false, })); app.use(passport.initialize()); app.use(passport.session()); mongoose.connect("mongodb://localhost:27017/userDB"); const userSchema = new mongoose.Schema({ email: String, password: String }); const User = new mongoose.model("User", userSchema); passport.use(User.createStrategy()); passport.serializeUser(User.serializeUser()); passport.deserializeUser(User.deserializeUser()); userSchema.plugin(passportLocalMongoose); ``` this is my code and can't find anything wrong with it
Seemed to misplace the plugin
Was just following and encountered this error. Tried searching google for solutions and can't find anything.