mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
fix: CSRF issue #51
This commit is contained in:
1 parent
2ac73a06c9
commit
d45fbee647
2 files changed
+2
No files matched your search
@@ -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,4 +1,5 @@
|
||||
import csrf from 'csurf'
|
||||
|
||||
const CSRF = csrf({ cookie: true })
|
||||
function csrfProtection(req, res, next) {
|
||||
if (req.method === 'POST') {
|
||||
|
||||
Reference in new issue
Block a user