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

Clear hash only if it contains known properties #4415

Merged
merged 4 commits into from Jan 19, 2022
Merged

Conversation

tnorling
Copy link
Collaborator

handleRedirectPromise clears the current hash before processing the redirect response. Today this logic doesn't care if the hash came from the current url or from the cache. This causes problems for hash routing scenarios where a custom (non-msal) hash may be removed, causing a route change before the hash can be processed.

This PR fixes this behavior by only clearing the current hash if it contains known response properties

Fixes #4400

@github-actions github-actions bot added the msal-browser Related to msal-browser package label Jan 18, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2022

Codecov Report

Merging #4415 (6808be4) into dev (7dd8b32) will not change coverage.
The diff coverage is 100.00%.

Flag Coverage Δ *Carryforward flag
msal-angular 96.39% <ø> (ø)
msal-browser 87.50% <100.00%> (ø)
msal-common 85.37% <ø> (ø) Carriedforward from 7dd8b32
msal-core 82.65% <ø> (ø) Carriedforward from 7dd8b32
msal-node 80.72% <ø> (ø) Carriedforward from 7dd8b32
msal-node-extensions 76.03% <ø> (ø) Carriedforward from 7dd8b32
msal-react 94.27% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...l-browser/src/interaction_client/RedirectClient.ts 100.00% <100.00%> (ø)

@tnorling tnorling marked this pull request as ready for review January 18, 2022 22:27
@tnorling tnorling merged commit deb2b22 into dev Jan 19, 2022
@tnorling tnorling deleted the fix-hash-clear branch January 19, 2022 21:32
@ghost
Copy link

ghost commented Feb 8, 2022

🎉@azure/msal-browser@v2.22.0 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msal-browser Related to msal-browser package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

handleRedirectPromise() in MSAL2.0 clears all hash values regardless of the fragment name
4 participants