mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 00:30:02 +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
dd550922fd
commit
c803c6c2ca
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