@sasjs/adapter 4.2.1 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -13
- package/index-dev.js +2 -2
- package/index.js +1 -1
- package/minified_sas9.js +1 -1
- package/node/main.js +1 -1
- package/package.json +1 -1
- package/src/auth/AuthManager.ts +6 -2
package/package.json
CHANGED
package/src/auth/AuthManager.ts
CHANGED
|
@@ -13,7 +13,7 @@ export class AuthManager {
|
|
|
13
13
|
public userLongName = ''
|
|
14
14
|
private loginUrl: string
|
|
15
15
|
private logoutUrl: string
|
|
16
|
-
private redirectedLoginUrl = `/SASLogon/home`
|
|
16
|
+
private redirectedLoginUrl = `/SASLogon` //SAS 9 M8 no longer redirects from `/SASLogon/home` to the login page. `/SASLogon` seems to be stable enough across SAS versions
|
|
17
17
|
constructor(
|
|
18
18
|
private serverUrl: string,
|
|
19
19
|
private serverType: ServerType,
|
|
@@ -138,6 +138,10 @@ export class AuthManager {
|
|
|
138
138
|
loginResponse = await this.sendLoginRequest(newLoginForm, loginParams)
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
// Sometimes due to redirection on SAS9 and SASViya we don't get the login response that says
|
|
142
|
+
// You have signed in. Therefore, we have to make an extra request for checking session to
|
|
143
|
+
// ensure either user is logged in or not.
|
|
144
|
+
|
|
141
145
|
const res = await this.checkSession()
|
|
142
146
|
isLoggedIn = res.isLoggedIn
|
|
143
147
|
this.userLongName = res.userLongName
|
|
@@ -321,7 +325,7 @@ export class AuthManager {
|
|
|
321
325
|
}
|
|
322
326
|
|
|
323
327
|
private getLoginForm(response: any) {
|
|
324
|
-
const pattern: RegExp = /<form.+action="(.*(Logon
|
|
328
|
+
const pattern: RegExp = /<form.+action="(.*(Logon|login)[^"]*).*>/
|
|
325
329
|
const matches = pattern.exec(response)
|
|
326
330
|
const formInputs: any = {}
|
|
327
331
|
|