From 5291e7f01c1d2f369fdc9e0ec188a76043c206b2 Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Mon, 3 Apr 2023 23:10:27 +0500 Subject: [PATCH] fix: regex for extracting login url fixed --- src/auth/AuthManager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/auth/AuthManager.ts b/src/auth/AuthManager.ts index b6bf709..043c90b 100644 --- a/src/auth/AuthManager.ts +++ b/src/auth/AuthManager.ts @@ -138,6 +138,10 @@ export class AuthManager { loginResponse = await this.sendLoginRequest(newLoginForm, loginParams) } + // Sometimes due to redirection on SAS9 and SASViya we don't get the login response that says + // You have signed in. Therefore, we have to make an extra request for checking session to + // ensure either user is logged in or not. + const res = await this.checkSession() isLoggedIn = res.isLoggedIn this.userLongName = res.userLongName @@ -321,7 +325,7 @@ export class AuthManager { } private getLoginForm(response: any) { - const pattern: RegExp = // + const pattern: RegExp = // const matches = pattern.exec(response) const formInputs: any = {}