Skip to content

Commit

Permalink
Fix: When frontend cannot renew token, log out the user
Browse files Browse the repository at this point in the history
Signed-off-by: Knut Ahlers <knut@ahlers.me>
  • Loading branch information
Luzifer committed Jul 3, 2024
1 parent b75af63 commit 75085da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 75085da

Please sign in to comment.