From 7e89f3818e422b31cee365626fbba3df9ab41c1b Mon Sep 17 00:00:00 2001 From: David van der Spek Date: Tue, 7 Mar 2023 17:23:45 +0100 Subject: [PATCH] UI: OIDC callback bug. (#18521) * don't error for other message events Signed-off-by: David van der Spek * add changelog Signed-off-by: David van der Spek * rename release note for changelog Signed-off-by: David van der Spek --------- Signed-off-by: David van der Spek --- changelog/18521.txt | 3 +++ ui/app/components/auth-jwt.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/18521.txt 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