Merge pull request #4009 from stianst/master

KEYCLOAK-4717 Added extra check for data content in receive message f…
This commit is contained in:
Stian Thorgersen 2017-04-06 10:42:37 +02:00 committed by GitHub
commit 859b575a12

View file

@ -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();