From 42e3f6d04574bac5f0df9f9cc9c5562cad37d1cb Mon Sep 17 00:00:00 2001 From: silverpill Date: Sun, 12 Mar 2023 23:36:59 +0000 Subject: [PATCH] Fix automatic logout on authentication error --- CHANGELOG.md | 4 ++++ src/components/SidebarLayout.vue | 11 +---------- src/views/HomeTimeline.vue | 13 ++++++++++++- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ec9023..2608e99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Enabled audio and video uploads. +### Fixed + +- Fixed automatic logout on authentication error. + ## [1.16.0] - 2023-03-08 ### Added diff --git a/src/components/SidebarLayout.vue b/src/components/SidebarLayout.vue index 5246089..3b7c50c 100644 --- a/src/components/SidebarLayout.vue +++ b/src/components/SidebarLayout.vue @@ -55,16 +55,7 @@ const emit = defineEmits<{(event: "reload-home"): void}>() function showHomeTimeline() { if (route.name === "home") { - try { - loadNotifications(ensureAuthToken()) - } catch (error: any) { - if (error.message === "access token is invalid") { - router.push({ name: "landing-page" }) - return - } else { - throw error - } - } + loadNotifications(ensureAuthToken()) emit("reload-home") } else { router.push({ name: "home" }) diff --git a/src/views/HomeTimeline.vue b/src/views/HomeTimeline.vue index ec85ec9..9fccba8 100644 --- a/src/views/HomeTimeline.vue +++ b/src/views/HomeTimeline.vue @@ -15,6 +15,7 @@