jaredhanson/passport — pull request #25 by marfalkov (2012-05-12 14:16:41+00:00)
Title: add support for options.failureCall

to be able to do something like this:

passport.authenticate('google', { failureRedirect: '/login', failureCall: function(req){
if (req.session) {
req.session.destroy(function(err){
// cannot access session here
console.log('session destroyed.');
});
}
}
}),