KEYCLOAK-4037 JS Adapter fails in Cordova mode for iOS apps
This commit is contained in:
parent
16aaa3bf01
commit
47ea1ade8a
1 changed files with 5 additions and 1 deletions
|
@ -587,7 +587,7 @@
|
||||||
|
|
||||||
req.onreadystatechange = function () {
|
req.onreadystatechange = function () {
|
||||||
if (req.readyState == 4) {
|
if (req.readyState == 4) {
|
||||||
if (req.status == 200) {
|
if (req.status == 200 || fileLoaded(req)) {
|
||||||
var config = JSON.parse(req.responseText);
|
var config = JSON.parse(req.responseText);
|
||||||
|
|
||||||
kc.authServerUrl = config['auth-server-url'];
|
kc.authServerUrl = config['auth-server-url'];
|
||||||
|
@ -633,6 +633,10 @@
|
||||||
return promise.promise;
|
return promise.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fileLoaded(xhr) {
|
||||||
|
return xhr.status == 0 && xhr.responseText && xhr.responseURL.startsWith('file:');
|
||||||
|
}
|
||||||
|
|
||||||
function setToken(token, refreshToken, idToken, timeLocal) {
|
function setToken(token, refreshToken, idToken, timeLocal) {
|
||||||
if (kc.tokenTimeoutHandle) {
|
if (kc.tokenTimeoutHandle) {
|
||||||
clearTimeout(kc.tokenTimeoutHandle);
|
clearTimeout(kc.tokenTimeoutHandle);
|
||||||
|
|
Loading…
Reference in a new issue