18 lines
No EOL
634 B
JavaScript
18 lines
No EOL
634 B
JavaScript
export default defineNuxtRouteMiddleware((to) => {
|
|
// Skip middleware in server-side rendering to avoid errors
|
|
if (process.server) return
|
|
|
|
// TODO: Temporarily disabled for testing - enable when authentication is set up
|
|
// Check if user is authenticated (you'll need to implement proper auth state)
|
|
// const isAuthenticated = useCookie('auth-token').value
|
|
|
|
// if (!isAuthenticated) {
|
|
// throw createError({
|
|
// statusCode: 401,
|
|
// statusMessage: 'Authentication required'
|
|
// })
|
|
// }
|
|
|
|
// TODO: Add proper role-based authorization
|
|
// For now, we assume anyone with a valid token is an admin
|
|
}) |