1
0
mirror of synced 2025-12-21 02:46:50 -05:00
Files
docs/middleware/handle-csrf-errors.js
Kevin Heis 8a56437c93 Pretty format (#20352)
* Update prettier flow to include JS

* Run prettier

* ...run prettier
2021-07-14 14:35:01 -07:00

9 lines
194 B
JavaScript

export default function handleCSRFError(error, req, res, next) {
// If the CSRF token is bad
if (error.code === 'EBADCSRFTOKEN') {
return res.sendStatus(403)
}
return next(error)
}