Skip to content

Commit

Permalink
fire logout completed on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnickii committed Oct 11, 2024
1 parent b4d8c0c commit 7dea10e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/mgt-components/src/components/mgt-login/mgt-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ export class MgtLogin extends MgtTemplatedTaskComponent {
const provider = Providers.globalProvider;
if (provider?.logout) {
await provider.logout();
}
};

private readonly completeLogout = () => {
const provider = Providers.globalProvider;
if (provider.state === ProviderState.SignedOut) {
this.userDetails = null;
if (provider.isMultiAccountSupportedAndEnabled) {
const activeAccount = provider.getActiveAccount();
Expand Down Expand Up @@ -297,6 +303,9 @@ export class MgtLogin extends MgtTemplatedTaskComponent {
}
this.fireCustomEvent('loginCompleted');
} else {
if (provider.logout) {
this.completeLogout();
}
this.userDetails = null;
}
}
Expand Down

0 comments on commit 7dea10e

Please sign in to comment.