jaredhanson/passport — pull request #48 by PatrickHeneise (2012-08-02 17:32:15+00:00)
Title: Update lib/passport/middleware/authenticate.js

A little fix to check req.flash support (has been dropped in express 3).

This is the middleware to use for the messages:

app.response.message = function(type, msg){
// reference `req.session` via the `this.req` reference
var sess = this.req.session;
// simply add the msg to an array for later
sess.messages = sess.messages || [];
sess.messages.push(msg);
return this;
};