1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-09 13:30:04 +00:00

chore: code refactor renamed variables/functions

This commit is contained in:
Saad Jutt
2021-09-08 05:49:24 +05:00
parent cd2b32f2f4
commit 19a57dbf6e
6 changed files with 21 additions and 16 deletions

View File

@@ -0,0 +1,18 @@
import { delay } from '../utils'
export async function verifySas9Login(loginPopup: Window) {
let isLoggedIn = false
let startTime = new Date()
let elapsedSeconds = 0
do {
await delay(1000)
if (loginPopup.closed) break
isLoggedIn =
loginPopup.window.location.href.includes('SASLogon') &&
loginPopup.window.document.body.innerText.includes('You have signed in.')
elapsedSeconds = (new Date().valueOf() - startTime.valueOf()) / 1000
} while (!isLoggedIn && elapsedSeconds < 5 * 60)
return { isLoggedIn }
}