mirror of
https://github.com/sasjs/server.git
synced 2026-01-14 17:30:05 +00:00
fix: added CSRF check for granting access via session authentication
This commit is contained in:
@@ -4,6 +4,13 @@ import webRouter from './web'
|
||||
|
||||
const router = express.Router()
|
||||
|
||||
router.use('/', csrfProtection, webRouter)
|
||||
router.use(csrfProtection)
|
||||
|
||||
router.use(function (req, res, next) {
|
||||
res.cookie('XSRF-TOKEN', req.csrfToken())
|
||||
next()
|
||||
})
|
||||
|
||||
router.use('/', webRouter)
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user