From f0b44ea93ba223f22bc260d76be312d0dc3b90a4 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Thu, 6 Apr 2017 08:49:32 +0200 Subject: [PATCH] KEYCLOAK-4717 Added extra check for data content in receive message for session iframe --- adapters/oidc/js/src/main/resources/keycloak.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/adapters/oidc/js/src/main/resources/keycloak.js b/adapters/oidc/js/src/main/resources/keycloak.js index 427bd07737..ff7fb6f5fc 100755 --- a/adapters/oidc/js/src/main/resources/keycloak.js +++ b/adapters/oidc/js/src/main/resources/keycloak.js @@ -835,9 +835,13 @@ if ((event.origin !== loginIframe.iframeOrigin) || (loginIframe.iframe.contentWindow !== event.source)) { return; } - - if (event.data != "unchanged") { + if (!(event.data == 'unchanged' || event.data == 'changed' || event.data == 'error')) { + return; + } + + + if (event.data != 'unchanged') { kc.clearToken(); } @@ -845,7 +849,7 @@ for (var i = callbacks.length - 1; i >= 0; --i) { var promise = callbacks[i]; - if (event.data == "unchanged") { + if (event.data == 'unchanged') { promise.setSuccess(); } else { promise.setError();