Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaces #18138 as the branch needed to be renamed following this comment. CC'in @hashishaw and @austingebauer as you were reviewing the previous PR.
When implementing vault with our OIDC provider, the popup window never closes and the OIDC callback never succeeds. This is because the main window is listening for message events from the popup window. However, in our OIDC consent page other message events originating from Intercom are sent and these break the callback handling. This is because the code implemented in #13133 will error if the first message event is not the one Vault expects. This PR effectively inverses the
if
statement so that thewhile
loop will function properly and wait for the proper event to catch.The events listed in the browser by executing
monitorEvents(window,"message")
in the browser console:The popup window for the OIDC login flow that is being referred to:
![image](https://user-images.githubusercontent.com/28541758/204567129-807e9c9b-1f3a-4bcd-af76-c987e9332843.png)