fix: CSRF issue #51

This commit is contained in:
chreamy committed 2024-01-18 03:23:39 -06:00
1 parent 2ac73a06c9
commit d45fbee647
2 files changed
+2

No files matched your search

+1
View File
@@ -9,6 +9,7 @@ import userRouter from './userRouter.js'
import config from '../../config.js'
import leaderboardController from '../controllers/leaderboardController.js'
import csrfProtection from '../../middleware/csrfProtection.js'
const router = Router()
if (!config.isProduction) {
+1
View File
@@ -1,4 +1,5 @@
import csrf from 'csurf'
const CSRF = csrf({ cookie: true })
function csrfProtection(req, res, next) {
if (req.method === 'POST') {