From 556a37e836117fca10c4d693066de670a84860dc Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 24 Aug 2026 19:24:14 +0300 Subject: [PATCH] login/logout/register woes --- src/components/desktop_nav/desktop_nav.js | 4 ++-- src/components/mobile_nav/mobile_nav.js | 2 +- .../oauth_callback/oauth_callback.js | 4 ++-- src/components/registration/registration.vue | 2 +- src/components/timeline/timeline.vue | 4 +++- src/stores/auth_flow.js | 4 ++-- src/stores/oauth.js | 2 +- src/stores/streaming.js | 1 - src/stores/timelines.js | 24 +++++++++++++------ test/unit/specs/stores/timelines.spec.js | 2 -- test/unit/specs/stores/users.spec.js | 1 - 11 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/components/desktop_nav/desktop_nav.js b/src/components/desktop_nav/desktop_nav.js index 32d0b37a9..15a5cfb15 100644 --- a/src/components/desktop_nav/desktop_nav.js +++ b/src/components/desktop_nav/desktop_nav.js @@ -135,9 +135,9 @@ export default { this.showConfirmLogout() } }, - doLogout() { + async doLogout() { + await useUsersStore().logout() this.$router.replace('/main/public') - useUsersStore().logout() this.hideConfirmLogout() }, onSearchBarToggled(hidden) { diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js index 163c0e9aa..97645ca73 100644 --- a/src/components/mobile_nav/mobile_nav.js +++ b/src/components/mobile_nav/mobile_nav.js @@ -145,9 +145,9 @@ const MobileNav = { } }, doLogout() { - this.$router.replace('/main/public') useUsersStore().logout() this.hideConfirmLogout() + this.$router.replace('/main/public') }, markNotificationsAsSeen() { useNotificationsStore().markNotificationsAsSeen() diff --git a/src/components/oauth_callback/oauth_callback.js b/src/components/oauth_callback/oauth_callback.js index bf6e03c9e..824ab7bda 100644 --- a/src/components/oauth_callback/oauth_callback.js +++ b/src/components/oauth_callback/oauth_callback.js @@ -16,10 +16,10 @@ const oac = { clientSecret, instance: useInstanceStore().server, code: this.code, - }).then(({ data: result }) => { + }).then(async ({ data: result }) => { oauthStore.setToken(result.access_token) - useUsersStore().loginUser(result.access_token) + await useUsersStore().loginUser(result.access_token) this.$router.push({ name: 'friends' }) }) } diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index 0abcfe656..0ad7c026a 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -303,7 +303,7 @@
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index 7e3eefce2..69657525c 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -1,5 +1,7 @@