adding locals as per conventions
This commit is contained in:
1 parent
e776beabd3
commit
270dff958f
1 file changed
+3
-3
+3
-3
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user