Skip to content

Commit

Permalink
Moved the logout callbacks to earlier in the callback chain. See http…
Browse files Browse the repository at this point in the history
  • Loading branch information
MumblesNZ committed Nov 19, 2020
1 parent 5fe6184 commit 546b6a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions adapters/oidc/js/src/main/resources/keycloak.js
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,8 @@

ref.addEventListener('loadstart', function(event) {
if (event.url.indexOf('http://localhost') == 0) {
kc.clearToken();
promise.setSuccess();
ref.close();
}
});
Expand All @@ -1430,16 +1432,19 @@
ref.close();
} else {
error = true;
promise.setError();
ref.close();
}
});

ref.addEventListener('exit', function(event) {
if (error) {
promise.setError();
// now handled in loaderror case
// promise.setError();
} else {
kc.clearToken();
promise.setSuccess();
// now handles on loadStart
// kc.clearToken();
// promise.setSuccess();
}
});

Expand Down

0 comments on commit 546b6a7

Please sign in to comment.