Merge pull request #891 from nilspreusker/ie9-compatibility

IE9 Compatibility
This commit is contained in:
Stian Thorgersen 2014-12-17 10:56:14 +01:00
commit ee62f5b1a1
2 changed files with 7 additions and 6 deletions

View file

@ -619,7 +619,7 @@
if (event.origin !== loginIframe.iframeOrigin) {
return;
}
var data = event.data;
var data = JSON.parse(event.data);
var promise = loginIframe.callbackMap[data.callbackId];
delete loginIframe.callbackMap[data.callbackId];
@ -652,7 +652,7 @@
msg.callbackId = createCallbackId();
loginIframe.callbackMap[msg.callbackId] = promise;
var origin = loginIframe.iframeOrigin;
loginIframe.iframe.contentWindow.postMessage(msg, origin);
loginIframe.iframe.contentWindow.postMessage(JSON.stringify(msg), origin);
} else {
promise.setSuccess();
}

View file

@ -17,14 +17,15 @@
return;
}
event.data.loggedIn = false;
var data = JSON.parse(event.data);
data.loggedIn = false;
var cookie = getCookie('KEYCLOAK_SESSION');
if (cookie) {
event.data.loggedIn = true;
event.data.session = cookie;
data.loggedIn = true;
data.session = cookie;
}
event.source.postMessage(event.data,
event.source.postMessage(JSON.stringify(data),
event.origin);
}
window.addEventListener("message", receiveMessage, false);