1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-08 07:00:04 +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

@@ -55,8 +55,9 @@ authRouter.post('/token', async (req, res) => {
const controller = new AuthController()
try {
const response = await controller.token(body)
const { accessToken } = response
res.send(response)
res.cookie('accessToken', accessToken).send(response)
} catch (err: any) {
res.status(403).send(err.toString())
}