1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-03 02:30:06 +00:00

chore: sasjs-tests compute only on viya, login order fix

This commit is contained in:
2021-06-02 11:00:08 +02:00
parent 2d0833061f
commit d8bdc02f09
3 changed files with 75 additions and 19 deletions

View File

@@ -34,7 +34,8 @@ export class AuthManager {
this.userName = loginParams.username
const { isLoggedIn, loginForm } = await this.checkSession()
let { isLoggedIn, loginForm } = await this.checkSession()
if (isLoggedIn) {
await this.loginCallback()
@@ -46,15 +47,15 @@ export class AuthManager {
let loginResponse = await this.sendLoginRequest(loginForm, loginParams)
if (isCredentialsVerifyError(loginResponse)) {
let newLoginForm = await this.getLoginForm(loginResponse)
loginResponse = await this.sendLoginRequest(newLoginForm, loginParams)
}
let loggedIn = isLogInSuccess(loginResponse)
if (!loggedIn) {
if (isCredentialsVerifyError(loginResponse)) {
let newLoginForm = await this.getLoginForm(loginResponse)
loginResponse = await this.sendLoginRequest(newLoginForm, loginParams)
}
const currentSession = await this.checkSession()
loggedIn = currentSession.isLoggedIn
}