adding locals as per conventions

This commit is contained in:
Nikola Bjelo committed 2018-10-23 12:47:17 +02:00
1 parent e776beabd3
commit 270dff958f
1 file changed
+3 -3
+3 -3
View File
@@ -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
}