From 48e18ba67dcf85be7b4d034565f4071daa0cc79f Mon Sep 17 00:00:00 2001 From: Adam French Date: Mon, 19 Oct 2026 19:51:29 +0100 Subject: [PATCH] =?UTF-8?q?fix(qa):=20ISSUE-001=20=E2=80=94=20leave=20the?= =?UTF-8?q?=20admin=20panel=20after=20logging=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Logging out on /admin cleared the session but left every admin form on screen, because the requiresAdmin guard only runs on navigation. Route to the login page once logOut() settles. Co-Authored-By: Claude Opus 5.5 --- vue/src/views/admin/Admin.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vue/src/views/admin/Admin.vue b/vue/src/views/admin/Admin.vue index 31fc575..33851f5 100644 --- a/vue/src/views/admin/Admin.vue +++ b/vue/src/views/admin/Admin.vue @@ -6,6 +6,7 @@ * imported, since reaching this page means you want them. */ import { ref, computed } from "vue"; +import { useRouter } from "vue-router"; import { useAuthStore } from "@/stores/auth"; import Button from "@/components/input/Button.vue"; @@ -21,6 +22,7 @@ import ManageUsers from "./ManageUsers.vue"; import ManageRadio from "./ManageRadio.vue"; const auth = useAuthStore(); +const router = useRouter(); const sections = [ { id: "user", label: "User", component: CreateUser }, @@ -40,8 +42,11 @@ const activeSection = computed(() => sections.find((s) => s.id === active.value), ); -function handleLogout() { - auth.logOut(); +// The requiresAdmin guard only runs on navigation, so logging out in place +// would leave the panel on screen for a signed-out visitor; leave it instead. +async function handleLogout() { + await auth.logOut(); + router.push("/admin/login"); }