refactor(auth): centralize role checks into utility

Removed direct user role string checks and replaced with type-safe utils.
This commit is contained in:
2026-06-16 18:30:26 +02:00 Unverified
parent b75e7bbafd
commit 942143ddc7
7 changed files with 61 additions and 26 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ const navLinks = [
]
const { isAuthenticated, user, logout } = useAuth()
const panelLabel = computed(() => user.value?.role?.toUpperCase() === 'ADMIN' ? 'Pannello' : 'Dashboard')
const panelLabel = computed(() => isAdmin(user.value?.role) ? 'Pannello' : 'Dashboard')
</script>
<template>