From 1ea10da921a423950a75953653fb1bb117d3b2f9 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 13 Jul 2024 11:44:51 +0200 Subject: [PATCH] Fix: Only replace when access_token is present Signed-off-by: Knut Ahlers --- src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 704d4a8..59e233f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -88,7 +88,9 @@ const app = createApp({ this.tokenUser = username window.localStorage.setItem('twitch-bot-token', JSON.stringify({ expiresAt, token, username })) // Nuke the Twitch auth-response from the browser history - this.$router.replace({ name: 'dashboard' }) + if (window.location.hash.includes('access_token=')) { + this.$router.replace({ name: 'dashboard' }) + } fetch(`config-editor/user?user=${this.tokenUser}`, this.$root.fetchOpts) .then((resp: Response) => this.$root.parseResponseFromJSON(resp))