You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the app.js file while we are using authentication over passport there is an update.
Starting from version 0.2.1, passport-local-mongoose adds a helper method createStrategy as static method to your schema. The createStrategy is responsible to setup passport-local LocalStrategy with the correct options. Bacuse of this no need to define LocalStrategy and using this lines of code : passport.use(new LocalStrategy(User.authenticate()));
We could update this lines as below:
const User = require('./models/user');
// CHANGE: USE "createStrategy" INSTEAD OF "authenticate"
passport.use(User.createStrategy());
The text was updated successfully, but these errors were encountered:
Hello @Colt
For the app.js file while we are using authentication over passport there is an update.
Starting from version 0.2.1, passport-local-mongoose adds a helper method createStrategy as static method to your schema. The createStrategy is responsible to setup passport-local LocalStrategy with the correct options. Bacuse of this no need to define LocalStrategy and using this lines of code : passport.use(new LocalStrategy(User.authenticate()));
We could update this lines as below:
const User = require('./models/user');
// CHANGE: USE "createStrategy" INSTEAD OF "authenticate"
passport.use(User.createStrategy());
The text was updated successfully, but these errors were encountered: