fix: CSRF issue #51

This commit is contained in:
chreamy committed 2024-01-18 03:15:38 -06:00
1 parent 91a9397c58
commit 2ac73a06c9
3 files changed
+11

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import csrf from 'csurf'
const CSRF = csrf({ cookie: true })
function csrfProtection(req, res, next) {
if (req.method === 'POST') {
CSRF(req, res, next)
} else {
next()
}
}
export default csrfProtection
Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB