diff --git a/src/AdminUI/src/App.vue b/src/AdminUI/src/App.vue index bfa5d41e..5a1e2d82 100644 --- a/src/AdminUI/src/App.vue +++ b/src/AdminUI/src/App.vue @@ -14,9 +14,9 @@ @@ -46,7 +46,7 @@ const vuetifyTheme = useTheme(); const { locale, t } = useI18n(); const currentLocale = ref(locale.value); -const loggedInUser = ref(null); +const loggedInUser = ref("?"); const availableLocales = [ { title: 'English', value: 'en' }, @@ -74,7 +74,23 @@ const setLoggedInUser = (username) => { const logout = () => { loggedInUser.value = null; - router.push('/login'); + fetch('/Invoke/auth/signout', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }) + .then(response => response.json()) + .then(data => { + if (data.ok) { + router.push('/login'); + } else { + console.error('Logout failed!'); + } + }) + .catch(error => { + console.error('Error during logout:', error); + }); }; watch(currentLocale, (newLocale) => { diff --git a/src/AdminUI/src/components/AdminPage.vue b/src/AdminUI/src/components/AdminPage.vue index c99ba3c5..5ea7032f 100644 --- a/src/AdminUI/src/components/AdminPage.vue +++ b/src/AdminUI/src/components/AdminPage.vue @@ -1,16 +1,17 @@