Once a user has been logged in, how do I reference this.req.user
from inside of a view?
I think this would involve updating the locals collection of the Jade middleware. I haven't been able to get a reference to this object though.
Up until now I've been doing the following...
app.use(jade.middleware({
viewPath: __dirname + '/views',
debug: true,
pretty: true,
compileDebug: true,
locals: {
moment: require('moment'),
_: require('lodash')
}
}));
And then in the view there'd be something like this...
span=moment(new Date(item.date)).calendar()
Of course now I have a user object that cannot be assigned at set-up.