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] Fix Promises in PCA APIs #2091
Conversation
const hash = await interactionHandler.monitorPopupForHash(popupWindow, this.config.system.windowHashTimeout); | ||
|
||
// Handle response from hash string. | ||
return await interactionHandler.handleCodeResponse(hash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The catch is a single catch for all issues seen in initialization, creating auth code client and handling the code response. Is that alright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we cache items in the request preflighting, we need to make sure that we clear it if there are any errors that happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plus cache the error for telemetry purposes. This is done in every API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment about the sample changes but otherwise LGTM
Fixes an issue where promises were not resolving in silent flow APIs, which wasn't clearing cache correctly. Should also fix #2089.