mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-08 08:10:08 +00:00
Fix: When frontend cannot renew token, log out the user
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
ed6cff0535
commit
3ed9d41fe8
1 changed files with 5 additions and 0 deletions
|
@ -122,6 +122,11 @@ const app = createApp({
|
||||||
fetch('config-editor/refreshToken', this.$root.fetchOpts)
|
fetch('config-editor/refreshToken', this.$root.fetchOpts)
|
||||||
.then((resp: Response) => this.$root.parseResponseFromJSON(resp))
|
.then((resp: Response) => this.$root.parseResponseFromJSON(resp))
|
||||||
.then((data: any) => this.login(data.token, new Date(data.expiresAt), data.user))
|
.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 {
|
unregisterTicker(id: string): void {
|
||||||
|
|
Loading…
Reference in a new issue