From b7dae5c88f96d1dd648c4347197af2f636de0681 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Wed, 7 Jan 2015 14:53:58 +0100 Subject: [PATCH] Fixes for regression introduced by KEYCLOAK-923 --- integration/js/src/main/resources/keycloak.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration/js/src/main/resources/keycloak.js b/integration/js/src/main/resources/keycloak.js index 964509fe31..51e564dd27 100755 --- a/integration/js/src/main/resources/keycloak.js +++ b/integration/js/src/main/resources/keycloak.js @@ -51,7 +51,7 @@ var configPromise = loadConfig(config); function processInit() { - var callback = parseCallback(window.location.search); + var callback = parseCallback(window.location.href); if (callback) { window.history.replaceState({}, null, callback.newUrl); @@ -534,6 +534,7 @@ break; default: oauth.newUrl += (oauth.newUrl.indexOf('?') == -1 ? '?' : '&') + p[0] + '=' + p[1]; + break; } } @@ -688,8 +689,9 @@ } else if (kc.redirectUri) { return kc.redirectUri; } else { - var redirectUri = location.href.substring(0, location.href.indexOf('#')); + var redirectUri = location.href; if (location.hash) { + redirectUri = redirectUri.substring(0, location.href.indexOf('#')); redirectUri += (redirectUri.indexOf('?') == -1 ? '?' : '&') + 'redirect_fragment=' + encodeURIComponent(location.hash.substring(1)); } return redirectUri;