diff --git a/src/App.vue b/src/App.vue index 7fc49c7..3e6596f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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; diff --git a/src/components/Chat.vue b/src/components/Chat.vue index 66bce7a..08e446a 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -787,6 +787,7 @@ export default { this.timelineWindow = null; this.typingMembers = []; this.initialLoadDone = false; + this.showCreatedRoomWelcomeHeader = false; // Stop RR timer this.stopRRTimer(); diff --git a/src/services/matrix.service.js b/src/services/matrix.service.js index 3a5b188..1575a8e 100644 --- a/src/services/matrix.service.js +++ b/src/services/matrix.service.js @@ -409,12 +409,21 @@ export default { // we need to hang on to the generated password and use that to login to a new // session, so only wipe the token in s that case. // Clear the access token - var user = JSON.parse(this.$store.state.auth.user); + var user = this.$store.state.auth.user; if (user.is_guest) { delete user.access_token; this.$store.commit("setUser", user); + // Login again - this.login(user); + this.login(user).catch(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); + }) } else { this.$store.commit("setUser", null); this.$store.commit("setCurrentRoomId", null);