Merge pull request #4110 from mstruk/KEYCLOAK-4037

KEYCLOAK-4037 JS Adapter fails in Cordova mode for iOS apps
This commit is contained in:
Stian Thorgersen authored and GitHub committed 2017-05-04 10:43:14 +02:00
commit 5fd704af58
1 file changed
+5 -1
@@ -587,7 +587,7 @@
req.onreadystatechange = function () {
if (req.readyState == 4) {
if (req.status == 200) {
if (req.status == 200 || fileLoaded(req)) {
var config = JSON.parse(req.responseText);
kc.authServerUrl = config['auth-server-url'];
@@ -633,6 +633,10 @@
return promise.promise;
}
function fileLoaded(xhr) {
return xhr.status == 0 && xhr.responseText && xhr.responseURL.startsWith('file:');
}
function setToken(token, refreshToken, idToken, timeLocal) {
if (kc.tokenTimeoutHandle) {
clearTimeout(kc.tokenTimeoutHandle);