docs/middleware/handle-csrf-errors.js

9 строки
203 B
JavaScript

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