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

fix: get csrf token from cookie if not present in header

This commit is contained in:
Saad Jutt
2022-05-16 15:30:08 +05:00
parent fadcc9bd29
commit f89389bbc6

View File

@@ -4,7 +4,7 @@ export const getPreProgramVariables = (req: any): PreProgramVars => {
const host = req.get('host')
const protocol = req.protocol + '://'
const { user, accessToken } = req
const csrfToken = req.headers['x-xsrf-token']
const csrfToken = req.headers['x-xsrf-token'] || req.cookies['XSRF-TOKEN']
const sessionId = req.cookies['connect.sid']
const { _csrf } = req.cookies