Fix: When frontend cannot renew token, log out the user

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-07-03 12:26:47 +02:00
parent 8194d1b80f
commit a12dbc0ed3
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -122,6 +122,11 @@ const app = createApp({
fetch('config-editor/refreshToken', this.$root.fetchOpts)
.then((resp: Response) => this.$root.parseResponseFromJSON(resp))
.then((data: any) => this.login(data.token, new Date(data.expiresAt), data.user))
.catch(err => {
// Being unable to renew a token is a reason to logout
this.logout()
throw err
})
},
unregisterTicker(id: string): void {