From 270dff958f35a9fc0046a2b17b515e1b3e780df9 Mon Sep 17 00:00:00 2001 From: Nikola Bjelo Date: Tue, 23 Oct 2018 12:47:17 +0200 Subject: [PATCH] adding locals as per conventions --- server/src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/index.js b/server/src/index.js index 9957d12db..1645af835 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -65,15 +65,15 @@ async function run () { }), function (err, req, res, next) { if (err.code === 'invalid_token') { - res.error = err.message + res.locals.error = err.message } return next() } ) const context = ({ req, res }) => { - if (res.error) { - throw new ForbiddenError(res.error) + if (res.locals.error) { + throw new ForbiddenError(res.locals.error) } return req }