Wipe guest accounts on password errors

This commit is contained in:
N Pex 2022-04-21 09:41:52 +00:00
parent e49f6e81c3
commit dc61bb2ba7
3 changed files with 19 additions and 2 deletions

View file

@ -63,6 +63,13 @@ export default {
})
.catch((error) => {
console.log("Error creating client", error);
if (error.data.errcode ==='M_FORBIDDEN' && this.currentUser.is_guest) {
// Guest account and password don't work. We are in a strange state, probably because
// of server cleanup of accounts or similar. Wipe account and restart...
this.$store.commit("setUser", null);
this.$store.commit("setCurrentRoomId", null);
this.$navigation.push({ path: "/login" }, -1);
}
})
.finally(() => {
this.loading = false;