Login on reload

To get a new access_token if the old one has expired. Should fix issue #36.
This commit is contained in:
N-Pex 2021-01-27 12:57:23 +01:00
parent 5645e32cf0
commit 933de4a2ec
5 changed files with 64 additions and 18 deletions

View file

@ -157,7 +157,7 @@ export default {
this.waitingForMembership = true;
const self = this;
this.$matrix
.getMatrixClient(this.currentUser)
.login(this.currentUser)
.then(() => {
self.$matrix.setCurrentRoomId(self.roomId); // Go to this room, now or when joined.
@ -246,7 +246,7 @@ export default {
this.loadingMessage = "Logging in...";
var clientPromise;
if (this.currentUser) {
clientPromise = this.$matrix.getMatrixClient(this.currentUser);
clientPromise = this.$matrix.login(this.currentUser);
} else {
clientPromise = this.$store.dispatch("auth/login", this.guestUser);
}