Skip to content

Commit ca324c2

Browse files
engineersamuelstianst
authored andcommitted
processInit should return a promise for setupCheckLoginIframe and should only call processCallback if that setupCheckLoginIframe is successful
1 parent b4532ec commit ca324c2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adapters/oidc/js/src/main/resources/keycloak.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,12 @@
159159
var callback = parseCallback(window.location.href);
160160

161161
if (callback) {
162-
setupCheckLoginIframe();
163-
window.history.replaceState({}, null, callback.newUrl);
164-
processCallback(callback, initPromise);
165-
return;
162+
return setupCheckLoginIframe().success(function() {
163+
window.history.replaceState({}, null, callback.newUrl);
164+
processCallback(callback, initPromise);
165+
}).error(function (e) {
166+
throw 'Could not initialize iframe';
167+
});
166168
} else if (initOptions) {
167169
if (initOptions.token && initOptions.refreshToken) {
168170
setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken);

0 commit comments

Comments
 (0)