Skip to content
Snippets Groups Projects
Commit 2be340a1 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Only emit a changed event in case the token has actually changed

Every change to person etc should also mean a new token, so we can reduce
duplicated events by checking if the token has changed.
parent 515b4751
Branches
No related tags found
No related merge requests found
......@@ -73,6 +73,7 @@ class VPUAuth extends VPULitElement {
let newPerson = false;
if (kc.authenticated) {
let tokenChanged = (this.token !== kc.token);
this.name = kc.idTokenParsed.name;
this.token = kc.token;
this.subject = kc.subject;
......@@ -82,7 +83,7 @@ class VPUAuth extends VPULitElement {
newPerson = true;
}
this.personId = personId;
this._setLoginStatus(LoginStatus.LOGGED_IN, true);
this._setLoginStatus(LoginStatus.LOGGED_IN, tokenChanged);
} else {
this.name = "";
this.token = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment