1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-04 21:30:05 +00:00

fix: added cookie for accessToken

This commit is contained in:
Saad Jutt
2022-03-09 05:06:06 +05:00
parent 0f4e38d51d
commit 698180ab7e
6 changed files with 72 additions and 4 deletions

View File

@@ -43,7 +43,9 @@ const authenticateToken = (
}
const authHeader = req.headers['authorization']
const token = authHeader?.split(' ')[1]
const token =
authHeader?.split(' ')[1] ??
(tokenType === 'accessToken' ? req.cookies.accessToken : '')
if (!token) return res.sendStatus(401)
jwt.verify(token, key, async (err: any, data: any) => {