app.use((req, res, next) => {
console.log('res.locals.user', res.toString(), 'req.session.passport', req.session.passport);
res.locals.user = req.user;
next();
});
not positive what this code is used for besides the obvious passing of user info from request to response object. What I do know is that the res.locals is a function function () { [native code] } and it cannot be coerced to a string.