Skip to content

Commit

Permalink
get changes msal fix for version changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alvesfabi committed May 11, 2024
1 parent 015d564 commit 9d84e41
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions webapp/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,15 @@ export function renderApp() {
store.dispatch(setAuthConfig(authConfig));

if (AuthHelper.isAuthAAD()) {
if (!msalInstance) {
msalInstance = new PublicClientApplication(AuthHelper.getMsalConfig(authConfig));
msalInstance
.initialize()
.then(() => {
if (!msalInstance) {
store.dispatch(setAuthConfig(undefined));
return;
}
msalInstance
.handleRedirectPromise()
.then((response) => {
if (response) {
msalInstance?.setActiveAccount(response.account);
}
})
.catch(() => {
store.dispatch(setAuthConfig(undefined));
});
})
.catch(() => {
store.dispatch(setAuthConfig(undefined));
});
}
msalInstance = new PublicClientApplication(AuthHelper.getMsalConfig(authConfig));
await msalInstance.initialize();

void msalInstance.handleRedirectPromise().then((response) => {
if (response) {
msalInstance.setActiveAccount(response.account);
}
});
}

// render with the MsalProvider if AAD is enabled
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down

0 comments on commit 9d84e41

Please sign in to comment.