client/api: fix cache not cleared on login
This led to weird anomalies when logging with valid password and then with invalid one.
This commit is contained in:
parent
2651cbb374
commit
d5c3d21951
1 changed files with 2 additions and 1 deletions
|
@ -122,6 +122,7 @@ class Api extends events.EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
login(userName, userPassword, doRemember) {
|
login(userName, userPassword, doRemember) {
|
||||||
|
this.cache = {};
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
this.userPassword = userPassword;
|
this.userPassword = userPassword;
|
||||||
|
@ -138,7 +139,7 @@ class Api extends events.EventTarget {
|
||||||
this.user = response;
|
this.user = response;
|
||||||
resolve();
|
resolve();
|
||||||
this.dispatchEvent(new CustomEvent('login'));
|
this.dispatchEvent(new CustomEvent('login'));
|
||||||
}).catch(response => {
|
}, response => {
|
||||||
reject(response.description);
|
reject(response.description);
|
||||||
this.logout();
|
this.logout();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue