Commit Graph
3 Commits
  • feat: implement auth middleware, user sync, and token state persistence
    - Define useAuth composable logic with syncUser, handleLoginSuccess, and logout methods
    - Add auth.ts and guest.ts route middlewares to guard routes based on authentication and user roles
    - Add auth.client.ts plugin to boot-sync logged in user details
    - Declare custom PageMeta type definitions to support role-based authorization rules
  • feat: configure API dev proxy and improve useApiFetch error handling
    - Add Nitro devProxy for local proxying of api/v1 and uploads to the backend server
    - Improve useApiFetch to dynamically clear auth state and navigate to login on 401/403 errors
    - Automatically strip Content-Type headers for multipart FormData upload request bodies
    - Add css rule to fix Bootstrap Italia navbar link border display
    - Add ts-expect-error tag to avoid type checking issues with bootstrap-italia bundle loading
  • feat: implement API composables for authentication and data fetching
    - Add useApiFetch composable for HTTP requests with auth token
    - Implement useAuth composable for authentication endpoints
    - Add useAdmin composable for admin operations
    - Add useOperator composable for operator management
    - Add useMembers composable for member data
    - Add usePublic composable for public reports
    - Add useReports composable for report operations
    
    Co-authored-by: Copilot <[email protected]>