Skip to content

Instantly share code, notes, and snippets.

@ralyodio
Created September 26, 2012 05:11
Show Gist options
  • Save ralyodio/3786219 to your computer and use it in GitHub Desktop.
Save ralyodio/3786219 to your computer and use it in GitHub Desktop.
//middleware
app.use(function(req, res, next){
if ( req.session.user ) {
req.session.logged_in = true;
}
res.locals.message = req.flash();
res.locals.session = req.session;
res.locals.q = req.body;
res.locals.err = false;
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment