From a12dbc0ed3fb20f9861a8de82d7cb312cbfa193d Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 3 Jul 2024 12:26:47 +0200 Subject: [PATCH] Fix: When frontend cannot renew token, log out the user Signed-off-by: Knut Ahlers --- src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.ts b/src/main.ts index 4f93a17..704d4a8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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 {