From 17aab138ed21284141d3c65df1cab894ed22e36c Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Wed, 3 Jan 2024 18:48:39 +0100 Subject: [PATCH] Fix checking admin mode, #144 --- src/user/AdminModeBanner.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/user/AdminModeBanner.vue b/src/user/AdminModeBanner.vue index 4f0961f..afa0822 100644 --- a/src/user/AdminModeBanner.vue +++ b/src/user/AdminModeBanner.vue @@ -3,12 +3,13 @@ import { useAuth } from "@/auth/auth.composable"; import ActionButton from "@/components/ActionButton.vue"; import useAdmin from "./admin.composable"; -const { requireAuthentication } = useAuth(); +const { refreshJwt } = useAuth(); const { adminMode, isAdmin, checkAdminMode, disableAdminMode } = useAdmin(); -requireAuthentication(() => { +(async () => { + await refreshJwt(); if (isAdmin.value) checkAdminMode(); -}); +})(); function disable() { disableAdminMode();