-
Notifications
You must be signed in to change notification settings - Fork 2.7k
msal-browser v5 lifecycle events not firing #8316
Copy link
Copy link
Closed
Labels
Needs: Author FeedbackAwaiting response from issue authorAwaiting response from issue authorbug-unconfirmedA reported bug that needs to be investigated and confirmedA reported bug that needs to be investigated and confirmedmsal-browserRelated to msal-browser packageRelated to msal-browser packagemsal-reactRelated to @azure/msal-reactRelated to @azure/msal-reactno-issue-activityIssue author has not responded in 5 daysIssue author has not responded in 5 dayspublic-clientIssues regarding PublicClientApplicationsIssues regarding PublicClientApplicationsquestionCustomer is asking for a clarification, use case or information.Customer is asking for a clarification, use case or information.
Metadata
Metadata
Assignees
Labels
Needs: Author FeedbackAwaiting response from issue authorAwaiting response from issue authorbug-unconfirmedA reported bug that needs to be investigated and confirmedA reported bug that needs to be investigated and confirmedmsal-browserRelated to msal-browser packageRelated to msal-browser packagemsal-reactRelated to @azure/msal-reactRelated to @azure/msal-reactno-issue-activityIssue author has not responded in 5 daysIssue author has not responded in 5 dayspublic-clientIssues regarding PublicClientApplicationsIssues regarding PublicClientApplicationsquestionCustomer is asking for a clarification, use case or information.Customer is asking for a clarification, use case or information.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Core Library
MSAL.js (@azure/msal-browser)
Core Library Version
5.1.0
Wrapper Library
MSAL React (@azure/msal-react)
Wrapper Library Version
5.0.3
Public or Confidential Client?
Public
Description
addEventCallback()onPublicClientApplication, afterinitialize()has no effect.Either the events like
EventType.LOGIN_SUCCESSare not emitted, or the event listeners aren't being addedThis worked fine in v4, seems to be broken in v5.
I'm having to hack around this using React hooks looking for changes in the account count and if non zero set the active account, it's pretty obnoxious workaround, but it seems to work.
Error Message
No error message, events simply not sent
MSAL Logs
No logs event not sent
Network Trace (Preferrably Fiddler)
MSAL Configuration
Relevant Code Snippets
Reproduction Steps
Expected Behavior
When adding an event listener with
msalInstance.addEventCallback( (event) => {
console.log({event}, "any event")
})
The callback is invoked
Identity Provider
Entra ID (formerly Azure AD) / MSA
Browsers Affected (Select all that apply)
Chrome
Regression
"@azure/msal-browser": "^4.12.0",