diff --git a/services/app/client/src/elements/ucdlib-iam-app.js b/services/app/client/src/elements/ucdlib-iam-app.js index 9a556e3..97edd36 100644 --- a/services/app/client/src/elements/ucdlib-iam-app.js +++ b/services/app/client/src/elements/ucdlib-iam-app.js @@ -194,7 +194,7 @@ export default class UcdlibIamApp extends Mixin(LitElement) const silentCheckSsoRedirectUri = window.location.origin + '/silent-check-sso.html'; // set up listeners keycloak listeners - // kc.onAuthRefreshError = () => {AuthModel.logout(true);}; + kc.onAuthRefreshError = () => {AuthModel.logout(true);}; kc.onAuthError = () => {AuthModel.redirectUnauthorized();}; kc.onAuthSuccess = () => { customElements.define('ucdlib-iam-app', UcdlibIamApp); diff --git a/services/app/client/src/models/AppStateModel.js b/services/app/client/src/models/AppStateModel.js index e123fdb..ff2719b 100644 --- a/services/app/client/src/models/AppStateModel.js +++ b/services/app/client/src/models/AppStateModel.js @@ -12,6 +12,9 @@ class AppStateModelImpl extends AppStateModel { this.defaultPage = 'home'; this.currentPage = this.defaultPage; this.store = AppStateStore; + + this.inject('AuthModel'); + } /** @@ -21,7 +24,7 @@ class AppStateModelImpl extends AppStateModel { */ set(update) { if ( update.location.path.length && update.location.path[0] == 'logout' ){ - this.logout(); + this.AuthModel.logout(); } const modals = document?.querySelectorAll?.('ucdlib-iam-modal');