diff --git a/middleware/load-options.js b/middleware/load-options.js index 712bec14..d33cbe72 100644 --- a/middleware/load-options.js +++ b/middleware/load-options.js @@ -49,8 +49,6 @@ module.exports = (req, res, next) => { } ); - console.log(res.locals.options); - if (res.locals.options.sha) { res.setHeader( 'X-note', diff --git a/middleware/load-user.js b/middleware/load-user.js index 182567a7..f16dbbc6 100644 --- a/middleware/load-user.js +++ b/middleware/load-user.js @@ -20,7 +20,7 @@ module.exports = async (req, res, next) => { path.join(__dirname, '..', 'users', `${id}.json`), 'utf8' ); - res.locals.user = JSON.parse(data); + res.locals.user = {...res.locals.user, ...JSON.parse(data)}; } catch ({code, message}) { res.code(500).send(`An internal error occurred - open an issue on https://github.com/remy/mit-license with the following information: ${message}`) return; diff --git a/routes/get.js b/routes/get.js index 2893d6c3..9a7447dd 100644 --- a/routes/get.js +++ b/routes/get.js @@ -48,7 +48,7 @@ module.exports = (req, res) => { gravatar = `Profile image`; - } else if (user.copyright && typeof user.copyright[0] === 'object' && user.gravatar) { + } else if (typeof user.copyright[0] === 'object' && user.gravatar) { // Supports multi-user format gravatar = `