Merge pull request #466 from stianst/master
KEYCLOAK-526 Fix iframe origin when auth server url is relative
This commit is contained in:
commit
153de54fe8
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue