Improve performance of csrf errors (#16136)
* Improve performance of csrf errors * Fix handle csrf error middleware Co-authored-by: Chiedo <chiedo@users.noreply.github.com>
This commit is contained in:
@@ -48,10 +48,5 @@ module.exports = async function handleError (error, req, res, next) {
|
||||
}
|
||||
}
|
||||
|
||||
// If the CSRF token is bad
|
||||
if (error.code === 'EBADCSRFTOKEN') {
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
res.status(500).send(await liquid.parseAndRender(layouts['error-500'], req.context))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user