From e2998a09b674733a2db213a81e97fe10cb81407d Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Fri, 30 Jan 2015 10:02:27 +0100 Subject: [PATCH] KEYCLOAK-1019 Fix to keycloak.js if auth-server-url ends with '/' --- integration/js/src/main/resources/keycloak.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/integration/js/src/main/resources/keycloak.js b/integration/js/src/main/resources/keycloak.js index 5161cb1c6a..efa7ff4bef 100755 --- a/integration/js/src/main/resources/keycloak.js +++ b/integration/js/src/main/resources/keycloak.js @@ -310,7 +310,11 @@ } function getRealmUrl() { - return kc.authServerUrl + '/realms/' + encodeURIComponent(kc.realm); + if (kc.authServerUrl.charAt(kc.authServerUrl.length - 1) == '/') { + return kc.authServerUrl + 'realms/' + encodeURIComponent(kc.realm); + } else { + return kc.authServerUrl + '/realms/' + encodeURIComponent(kc.realm); + } } function getOrigin() {