csrf token

This commit is contained in:
chreamy committed 2024-01-20 00:11:48 -06:00
1 parent d45fbee647
commit 42278ad51b
8 files changed
+44 -82

No files matched your search

-12
View File
@@ -1,12 +0,0 @@
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