You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have discovered a bug in the plugin, where the EventListener multiplies itself on login or logout when using platform 'capacitor'.
This results in many 400 bad request errors when trying to receive a token from Keycloak:
Also on iOS we had to click on login button seveeral times, before the login really worked...
The solution simply was, to remove the EventListerners after running the Event code in keycloak.js file starting in line 1615:
if(type=='capacitor'){loginIframe.enable=false;return{login: function(options){varpromise=createPromise();varloginUrl=kc.createLoginUrl(options);constaddUrlListener=window.Capacitor.Plugins.App.addListener('appUrlOpen',(data)=>{window.cordova.plugins.browsertab.close();varoauth=parseCallback(data.url);processCallback(oauth,promise);addUrlListener.remove();// <--- REMOVE THE EVENT LISTENER HERE});window.cordova.plugins.browsertab.openUrl(loginUrl);returnpromise.promise;},logout: function(options){varpromise=createPromise();varlogoutUrl=kc.createLogoutUrl(options);constaddUrlListener=window.Capacitor.Plugins.App.addListener('appUrlOpen',(data)=>{window.cordova.plugins.browsertab.close();kc.clearToken();promise.setSuccess();addUrlListener.remove();// <--- REMOVE THE EVENT LISTENER HERE});window.cordova.plugins.browsertab.openUrl(logoutUrl);returnpromise.promise;},
...
The text was updated successfully, but these errors were encountered:
We have discovered a bug in the plugin, where the EventListener multiplies itself on login or logout when using platform 'capacitor'.
This results in many 400 bad request errors when trying to receive a token from Keycloak:
Also on iOS we had to click on login button seveeral times, before the login really worked...
The solution simply was, to remove the EventListerners after running the Event code in keycloak.js file starting in line 1615:
The text was updated successfully, but these errors were encountered: