fix: Revert dashboard routing to use existing structure
All checks were successful
Build And Push Image / docker (push) Successful in 1m49s

- Created missing admin.ts middleware file
- Reverted dashboard router to use old /dashboard/{tier} structure
- Production deployment still uses the old structure
- New role-based structure (/admin/dashboard, etc.) will be enabled later
- Fixes dashboard display issue where nothing was showing

The new structure is ready but needs gradual deployment to avoid breaking production.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-30 22:24:27 +02:00
parent 8b1dd4d083
commit 7c49b9db66
3 changed files with 21 additions and 11 deletions

17
middleware/admin.ts Normal file
View File

@@ -0,0 +1,17 @@
// middleware/admin.ts
export default defineNuxtRouteMiddleware((to, from) => {
const { isAuthenticated, isAdmin } = useAuth();
// Check if user is authenticated
if (!isAuthenticated.value) {
return navigateTo('/login');
}
// Check if user has admin privileges
if (!isAdmin.value) {
throw createError({
statusCode: 403,
statusMessage: 'Access denied. Administrator privileges required.'
});
}
});