Skip to content

[BUG] The event 'logoutCompleted' for the component mgt-login is not firing. #2951

@GyllionElderen

Description

@GyllionElderen

Describe the bug
The event 'logoutCompleted' for the component mgt-login is not firing.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new .NET 6.0 application
  2. Enter the following script in the header section to include the mgt library: <script src="@("https://unpkg.com/@microsoft/mgt@3/dist/bundle/mgt-loader.js")"></script> (also make sure to that JQuery has been included for the following steps).
  3. In the Index.html put the following elements to get the "Sign In" button. Make sure to replace the "(YOUR CLIENT ID)" section with the client ID of your app registration in Azure Entra ID:
<mgt-msal2-provider client-id="(YOUR CLIENT ID)"></mgt-msal2-provider>
<mgt-login></mgt-login>

  1. In the site.js file, put the following code:
$(document).ready(function () {
    document.querySelector('mgt-login').addEventListener('logoutCompleted', function () { console.log('Logout Completed!') });
});
  1. Run the application and sign in. Afterwards sign out again and check the console. No "Logout Completed!" log is visible in the console.

Expected behavior
The 'logoutCompleted' is firing and the "Logout Completed!" message is visible in the console.

Environment (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome, Firefox, Edge
  • Framework: ASP.NET Core, .NET 6.0
  • MGT Version: 3.1.3
  • Provider: mgt-msal2-provider

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Done ✔️

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions