1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-17 17:10:05 +00:00

fix: regex for extracting login url fixed

This commit is contained in:
2023-04-03 23:10:27 +05:00
parent 6aa12ee950
commit 5291e7f01c

View File

@@ -138,6 +138,10 @@ export class AuthManager {
loginResponse = await this.sendLoginRequest(newLoginForm, loginParams) 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() const res = await this.checkSession()
isLoggedIn = res.isLoggedIn isLoggedIn = res.isLoggedIn
this.userLongName = res.userLongName this.userLongName = res.userLongName
@@ -321,7 +325,7 @@ export class AuthManager {
} }
private getLoginForm(response: any) { private getLoginForm(response: any) {
const pattern: RegExp = /<form.+action="(.*(Logon)|(login)[^"]*).*>/ const pattern: RegExp = /<form.+action="(.*(Logon|login)[^"]*).*>/
const matches = pattern.exec(response) const matches = pattern.exec(response)
const formInputs: any = {} const formInputs: any = {}