diff --git a/packages/auth/src/auth-keycloak.js b/packages/auth/src/auth-keycloak.js index f57c681db29529046fc487173cf1f766ec640506..840c611e4d67be7246943e05d73c048a24ab28fd 100644 --- a/packages/auth/src/auth-keycloak.js +++ b/packages/auth/src/auth-keycloak.js @@ -87,6 +87,7 @@ export class AuthKeycloak extends AdapterLitElement { window.DBPPersonId = this.personId; window.DBPPerson = this.person; + this.sendSetPropertyEvents(); this._setLoginStatus(LoginStatus.LOGGED_IN, tokenChanged || newPerson); } else { if (this._loginStatus === LoginStatus.LOGGED_IN) { @@ -106,6 +107,7 @@ export class AuthKeycloak extends AdapterLitElement { window.DBPPersonId = this.personId; window.DBPPerson = this.person; + this.sendSetPropertyEvents(); this._setLoginStatus(LoginStatus.LOGGED_OUT); } @@ -141,6 +143,15 @@ export class AuthKeycloak extends AdapterLitElement { this.dispatchEvent(this.keycloakDataUpdateEvent); } + sendSetPropertyEvents() { + this.sendSetPropertyEvent('auth-subject', this.subject); + this.sendSetPropertyEvent('auth-token', this.token); + this.sendSetPropertyEvent('auth-token-parsed', this.tokenParsed); + this.sendSetPropertyEvent('user-full-name', this.name); + this.sendSetPropertyEvent('person-id', this.personId); + this.sendSetPropertyEvent('person', this.person); + } + _setLoginStatus(status, force) { if (this._loginStatus === status && !force) return;