feat(portal): auth persistence, shift visibility, profile page, and UI polish
- Fix session persistence: add loading state to App.vue, hydrate portal store in router guards so page refresh preserves auth + event context - Fix shift visibility for festivals: query child event time slots so shifts on sub-events appear in the portal - Add profile page with editable personal info and password change - Add backend endpoints: PUT /portal/profile and PUT /portal/password - Fix registration form: make first_name/last_name editable for logged-in users - Restyle login page: remove Vuexy illustration, center form with Crewli branding - Improve dashboard StatusCard with action cards, icons, and upcoming shift count - Enhance shift cards with status border colors and availability progress bars Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Router } from 'vue-router'
|
||||
import { useAuthStore } from '@/stores/useAuthStore'
|
||||
import { usePortalStore } from '@/stores/usePortalStore'
|
||||
|
||||
const guestOnlyPaths = ['/login', '/wachtwoord-vergeten', '/wachtwoord-resetten']
|
||||
|
||||
@@ -11,6 +12,12 @@ export function setupGuards(router: Router) {
|
||||
await authStore.initialize()
|
||||
}
|
||||
|
||||
// Hydrate portal data once after auth is confirmed
|
||||
if (authStore.isAuthenticated) {
|
||||
const portalStore = usePortalStore()
|
||||
await portalStore.hydrateIfNeeded()
|
||||
}
|
||||
|
||||
const requiresAuth = to.meta.requiresAuth === true
|
||||
|
||||
// Public routes — no auth check needed
|
||||
|
||||
Reference in New Issue
Block a user