- Add admin middleware protecting /admin page (ROLE_ADMIN check) - Fix useAvatarService to use useApi() with FormData detection - Create extractIdFromIri() utility, replace manual IRI parsing - Remove redundant Nitro devProxy (Vite proxy handles dev) Tickets: T-014, T-015, T-017, T-021 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 lines
200 B
TypeScript
8 lines
200 B
TypeScript
export default defineNuxtRouteMiddleware(() => {
|
|
const auth = useAuthStore()
|
|
|
|
if (!auth.isAuthenticated || !auth.user?.roles?.includes('ROLE_ADMIN')) {
|
|
return navigateTo('/')
|
|
}
|
|
})
|