1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00

fix(security): missing cookie flags are added

This commit is contained in:
Saad Jutt
2022-07-20 01:40:31 +05:00
parent 1b234eb2b1
commit 526402fd73

View File

@@ -1,4 +1,5 @@
import express from 'express'
import { cookieOptions } from '../../app'
import { WebController } from '../../controllers/web'
import { authenticateAccessToken, desktopRestrict } from '../../middlewares'
import { authorizeValidation, loginWebValidation } from '../../utils'
@@ -13,7 +14,7 @@ webRouter.get('/', async (req, res) => {
} catch (_) {
response = 'Web Build is not present'
} finally {
res.cookie('XSRF-TOKEN', req.csrfToken())
res.cookie('XSRF-TOKEN', req.csrfToken(), cookieOptions)
return res.send(response)
}