Setting up connect-flash middleware for use by passport
问题 I want to access the message that my passport strategy specifies in its callback, like this: done(null, false, { message: 'No such user.' }); . I found out so far that these messages can be displayed by passing the option failureFlash: true into the passport.authenticate() function, the usage of which again requires connect-flash middleware to be installed. So I installed the module and added var flash = require('connect-flash); to my source, as well as app.use(flash()); to the configuration