From e37bb182c3bf48af2598beabd361567564c1dd11 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Thu, 4 Aug 2022 05:04:43 +0500 Subject: [PATCH 1/2] fix(server): csrf cookie is created explicitly --- src/auth/AuthManager.ts | 12 ++++++++++-- src/request/RequestClient.ts | 10 +++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/auth/AuthManager.ts b/src/auth/AuthManager.ts index c5bb188..a9dce8a 100644 --- a/src/auth/AuthManager.ts +++ b/src/auth/AuthManager.ts @@ -223,9 +223,17 @@ export class AuthManager { private async getNewLoginForm() { if (this.serverType === ServerType.Sasjs) { - // server will be sending CSRF cookie, + // server will be sending CSRF token in response, + // need to save in cookie so that, // http client will use it automatically - return this.requestClient.get('/', undefined) + return this.requestClient.get('/', undefined).then(({ result }) => { + const cookie = + /