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

feat(auth): added multi-language support to logIn method

This commit is contained in:
Yury
2024-06-20 17:15:05 +03:00
parent 4c4511913c
commit 053b07769a
9 changed files with 169 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
import { delay } from '../utils'
import { enLoginSuccessHeader } from './AuthManager'
export async function verifySasViyaLogin(loginPopup: Window): Promise<{
isLoggedIn: boolean
@@ -20,9 +21,7 @@ export async function verifySasViyaLogin(loginPopup: Window): Promise<{
if (loginPopup.closed) break
isAuthorized =
loginPopup.window.location.href.includes('SASLogon') ||
loginPopup.window.document.body?.innerText?.includes(
'You have signed in.'
)
loginPopup.window.document.body?.innerText?.includes(enLoginSuccessHeader)
elapsedSeconds = (new Date().valueOf() - startTime.valueOf()) / 1000
} while (!isAuthorized && elapsedSeconds < 5 * 60)