Replace composable with Pinia store for persistent auth state
This commit is contained in:
@@ -396,13 +396,15 @@ import { useRoute } from 'vue-router'
|
||||
import { Menu, X, ChevronDown } from 'lucide-vue-next'
|
||||
|
||||
const route = useRoute()
|
||||
const authStore = useAuthStore()
|
||||
const isMobileMenuOpen = ref(false)
|
||||
const mobileSubmenu = ref(null)
|
||||
const mannschaften = ref([])
|
||||
const hasGalleryImages = ref(false)
|
||||
|
||||
// Use global auth state
|
||||
const { isLoggedIn, userRole, isAdmin, checkAuth } = useAuth()
|
||||
// Reactive auth state from store
|
||||
const isLoggedIn = computed(() => authStore.isLoggedIn)
|
||||
const isAdmin = computed(() => authStore.isAdmin)
|
||||
|
||||
// Automatisches Setzen des Submenus basierend auf der Route
|
||||
const currentSubmenu = computed(() => {
|
||||
@@ -486,7 +488,7 @@ const checkGalleryImages = async () => {
|
||||
onMounted(() => {
|
||||
loadMannschaften()
|
||||
checkGalleryImages()
|
||||
checkAuth()
|
||||
authStore.checkAuth()
|
||||
})
|
||||
|
||||
const toggleSubmenu = (menu) => {
|
||||
|
||||
Reference in New Issue
Block a user