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

msal-browser wipes history state #7311

Open
2 tasks
CreativeTechGuy opened this issue Sep 13, 2024 · 0 comments
Open
2 tasks

msal-browser wipes history state #7311

CreativeTechGuy opened this issue Sep 13, 2024 · 0 comments
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package Needs: Attention 👋 Awaiting response from the MSAL.js team public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@CreativeTechGuy
Copy link

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.23.0

Wrapper Library

Not Applicable

Wrapper Library Version

None

Public or Confidential Client?

Public

Description

This line wipes the history state after loading the page which breaks routers.

Error Message

No response

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

N/A

Relevant Code Snippets

This line:

https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/22d3070a860fc6b301589af9cefa0cecbb6f4e14/lib/msal-browser/src/utils/BrowserUtils.ts#L27

Needs to be changed to:


contentWindow.history.replaceState(contentWindow.history.state, "", `${contentWindow.location.origin}${contentWindow.location.pathname}${contentWindow.location.search}`)

Reproduction Steps

  1. Immediately upon loading the page, call history.replaceState({ someData: 1 }, "")
  2. Authenticate with MSAL
  3. History state has been wiped after the redirect finishes

Expected Behavior

MSAL doesn't erase user data

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome, Firefox, Edge, Safari

Regression

No response

Source

External (Customer)

@CreativeTechGuy CreativeTechGuy added bug-unconfirmed A reported bug that needs to be investigated and confirmed question Customer is asking for a clarification, use case or information. labels Sep 13, 2024
@github-actions github-actions bot added msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications labels Sep 13, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package Needs: Attention 👋 Awaiting response from the MSAL.js team public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

1 participant