Skip to content

Commit

Permalink
fix: prevent msal 'BrowserAuthError: interaction_in_progress' excepti…
Browse files Browse the repository at this point in the history
…on (#170)
  • Loading branch information
rentallect authored Jul 12, 2023
1 parent 9a3c812 commit 0e91756
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -1002,11 +1002,16 @@ class ZitiBrowzerRuntime {
// If no accounts found, it means we need to do an AzureAD login
if (accounts.length === 0) {

let msal_loginRequest = {
scopes: ZBR_CONSTANTS.AZURE_AD_SCOPES,
};

window.zitiBrowzerRuntime.authClient.loginRedirect( msal_loginRequest );
// Only initiate login redirect if one is not already in flight...
if (isNull( sessionStorage.getItem("msal.interaction.status") )) {

let msal_loginRequest = {
scopes: ZBR_CONSTANTS.AZURE_AD_SCOPES,
};

await window.zitiBrowzerRuntime.authClient.loginRedirect( msal_loginRequest );

}

await window.zitiBrowzerRuntime.await_azure_ad_accountId();

Expand Down

0 comments on commit 0e91756

Please sign in to comment.