Merge pull request #466 from stianst/master

KEYCLOAK-526 Fix iframe origin when auth server url is relative
This commit is contained in:
Stian Thorgersen 2014-06-16 17:55:27 +01:00
commit 153de54fe8

View file

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