From 87b243ed59f12cccc945a1097afda600d090d67e Mon Sep 17 00:00:00 2001 From: danren Date: Fri, 2 Dec 2016 13:30:53 +0100 Subject: [PATCH] Fix for KEYCLOAK-3961 --- adapters/oidc/js/src/main/resources/keycloak.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/adapters/oidc/js/src/main/resources/keycloak.js b/adapters/oidc/js/src/main/resources/keycloak.js index ba27ed0cfc..70b318ec4b 100755 --- a/adapters/oidc/js/src/main/resources/keycloak.js +++ b/adapters/oidc/js/src/main/resources/keycloak.js @@ -846,14 +846,15 @@ kc.clearToken(); } - for (var i = loginIframe.callbackList.length - 1; i >= 0; --i) { - var promise = loginIframe.callbackList[i]; + var callbacks = loginIframe.callbackList.splice(0, loginIframe.callbackList.length); + + for (var i = callbacks.length - 1; i >= 0; --i) { + var promise = callbacks[i]; if (event.data == "unchanged") { promise.setSuccess(); } else { promise.setError(); } - loginIframe.callbackList.splice(i, 1); } };