KEYCLOAK-526 Fix iframe origin when auth server url is relative

This commit is contained in:
Stian Thorgersen 2014-06-16 17:55:03 +01:00
parent 9228f0c076
commit 2866f6fc23

View file

@ -531,7 +531,11 @@ var Keycloak = function (config) {
iframe.onload = function() {
var realmUrl = getRealmUrl();
loginIframe.iframeOrigin = realmUrl.substring(0, realmUrl.indexOf('/', 8));
if (realmUrl.charAt(0) === '/') {
loginIframe.iframeOrigin = window.location.origin;
} else {
loginIframe.iframeOrigin = realmUrl.substring(0, realmUrl.indexOf('/', 8));
}
loginIframe.iframe = iframe;
}