Skip to content

Conversation

@konstantin-msft
Copy link
Collaborator

  • Gracefully handle old interaction format
@github-actions github-actions bot added the msal-browser Related to msal-browser package label May 2, 2025
@konstantin-msft konstantin-msft linked an issue May 2, 2025 that may be closed by this pull request
2 tasks
peterzenz
peterzenz previously approved these changes May 2, 2025
try {
return value ? JSON.parse(value) : null;
} catch (e) {
// Remove interaction and other temp keys when redirect begins on version <4.10.0 and completes on 4.10.0+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment isn't really accurate here. You're not checking versions explicitly, you're really saying if I can't parse the old state then let's clean it up for a subsequent go. We can note for historic reasons that there we a break in 4.10.0 that needs this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the comment

return value ? JSON.parse(value) : null;
} catch (e) {
// Remove interaction and other temp keys when redirect begins on version <4.10.0 and completes on 4.10.0+
this.removeTemporaryItem(key);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a warning log here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// Remove interaction and other temp keys when redirect begins on version <4.10.0 and completes on 4.10.0+
this.removeTemporaryItem(key);
this.resetRequestCache();
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the auth code still in the url if I get into this state?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Added hash clean up as well

@konstantin-msft konstantin-msft merged commit 241099b into dev May 2, 2025
7 checks passed
@konstantin-msft konstantin-msft deleted the gracefully_handle_old_interaction_format branch May 2, 2025 22:06
jo-arroyo pushed a commit that referenced this pull request May 19, 2025
- Gracefully handle old interaction format
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

5 participants