node.js - how to visualize message in passport.js during local strategy configuration -


i don't know how visualize message in passport.js. when run app.js, no message pop out. after check documents, middleware "connect-flash" need required, need use req.flash , res.locals. don't know how configure it, can help? new in node.js , express.

app.use(require('connect-flash')()); passport.use(new strategy(     function (username, password, cb) {         db.users.findbyusername(username, function (err, user) {             if (err) { return cb(err); }             if (!user) { return cb(null, false, { message: 'incorrect username.' }); } // how visualize message?             if (user.password != password) { return cb(null, false, { message: 'incorrect userpassword.' }); } //how visualize message?             return cb(null, user);         });     })); 


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -