Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify other open tabs of updates to localStorage #7550

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

tnorling
Copy link
Collaborator

In v4 we added encryption of localStorage entries, which also makes use of an in-memory cache to avoid constantly decrypting localStorage. This had the side effect of creating scenarios where multiple open tabs may have diverging cache states until they refresh and resync with localStorage. This PR adds broadcasting of localStorage updates to notify other open tabs or other instances of MSAL they should pull the latest changes into their respective in-memory cache objects.

On a related note: This PR also implements broadcasting for the Account Added and Account Removed events since these can no longer rely on the localStorage update events due to those values now being encrypted.

@github-actions github-actions bot added msal-browser Related to msal-browser package msal-common Related to msal-common package labels Jan 31, 2025
@github-actions github-actions bot added the documentation Related to documentation. label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-browser Related to msal-browser package msal-common Related to msal-common package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant