Skip to content

Commit

Permalink
fix: fire logout completed on logout (#3332)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnickii authored Oct 17, 2024
1 parent 9666b8b commit e2edc88
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 e2edc88

Please sign in to comment.