UI: OIDC callback bug. (#18521)

* don't error for other message events

Signed-off-by: David van der Spek <vanderspek.david@gmail.com>

* add changelog

Signed-off-by: David van der Spek <vanderspek.david@gmail.com>

* rename release note for changelog

Signed-off-by: David van der Spek <vanderspek.david@gmail.com>

---------

Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
This commit is contained in:
David van der Spek 2023-03-07 17:23:45 +01:00 committed by GitHub
parent 6e18136365
commit 7e89f3818e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

3
changelog/18521.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: wait for wanted message event during OIDC callback instead of using the first message event
```

View File

@ -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