mirror of
https://github.com/sasjs/server.git
synced 2025-12-12 03:54:34 +00:00
fix(security): missing cookie flags are added
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
|
import { cookieOptions } from '../../app'
|
||||||
import { WebController } from '../../controllers/web'
|
import { WebController } from '../../controllers/web'
|
||||||
import { authenticateAccessToken, desktopRestrict } from '../../middlewares'
|
import { authenticateAccessToken, desktopRestrict } from '../../middlewares'
|
||||||
import { authorizeValidation, loginWebValidation } from '../../utils'
|
import { authorizeValidation, loginWebValidation } from '../../utils'
|
||||||
@@ -13,7 +14,7 @@ webRouter.get('/', async (req, res) => {
|
|||||||
} catch (_) {
|
} catch (_) {
|
||||||
response = 'Web Build is not present'
|
response = 'Web Build is not present'
|
||||||
} finally {
|
} finally {
|
||||||
res.cookie('XSRF-TOKEN', req.csrfToken())
|
res.cookie('XSRF-TOKEN', req.csrfToken(), cookieOptions)
|
||||||
|
|
||||||
return res.send(response)
|
return res.send(response)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user