test(AuthManager): specs added for redirected login

This commit is contained in:
Saad Jutt
2021-09-08 13:04:03 +05:00
parent e0b09adbba
commit a00bf5ba67
4 changed files with 193 additions and 94 deletions
+12
View File
@@ -31,6 +31,18 @@ export class AuthManager {
public async redirectedLogIn({
onLoggedOut
}: LoginOptions): Promise<LoginResult> {
const { isLoggedIn: isLoggedInAlready, userName: currentSessionUsername } =
await this.fetchUserName()
if (isLoggedInAlready) {
await this.loginCallback()
return {
isLoggedIn: true,
userName: currentSessionUsername
}
}
const loginPopup = await openWebPage(
this.loginPreventRedirectUrl,
'SASLogon',