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:
rr- 2016-06-19 21:37:44 +02:00
parent 2651cbb374
commit d5c3d21951
1 changed files with 2 additions and 1 deletions

View File

@ -122,6 +122,7 @@ class Api extends events.EventTarget {
}
login(userName, userPassword, doRemember) {
this.cache = {};
return new Promise((resolve, reject) => {
this.userName = userName;
this.userPassword = userPassword;
@ -138,7 +139,7 @@ class Api extends events.EventTarget {
this.user = response;
resolve();
this.dispatchEvent(new CustomEvent('login'));
}).catch(response => {
}, response => {
reject(response.description);
this.logout();
});