diff --git a/changelog/18521.txt b/changelog/18521.txt new file mode 100644 index 000000000..4111aea2c --- /dev/null +++ b/changelog/18521.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: wait for wanted message event during OIDC callback instead of using the first message event +``` diff --git a/ui/app/components/auth-jwt.js b/ui/app/components/auth-jwt.js index 41110ebbf..031011232 100644 --- a/ui/app/components/auth-jwt.js +++ b/ui/app/components/auth-jwt.js @@ -104,7 +104,7 @@ export default Component.extend({ // ensure that postMessage event is from expected source while (true) { const event = yield waitForEvent(thisWindow, 'message'); - if (event.data.source === 'oidc-callback' && event.isTrusted && event.origin === thisWindow.origin) { + if (event.origin === thisWindow.origin && event.isTrusted && event.data.source === 'oidc-callback') { return this.exchangeOIDC.perform(event.data, oidcWindow); } // continue to wait for the correct message