usePortalAuthStore is deleted — its 114 lines were a slim wrapper over the same /auth/me endpoint useAuthStore already consumes. The merged store gains the full set of additions Bert specified for B2a: State: - availableContexts / defaultContext (from /auth/me contexts block) - lastContext (localStorage-persisted) - portalToken (in-memory only, for the bearer-axios flavour) Getters: isPortalUser, isOrganizerUser, isPlatformAdmin (alias of isSuperAdmin), showContextSwitcher, hasRole(), hasAnyRole(). Actions: login(), verifyMfa() — both return typed discriminated unions so login.vue (Phase H) consumes results without branching on raw API response shapes. setLastContext, setPortalToken, resolveLandingRoute, clearAll. clearAll dynamically imports usePortalStore.reset() to clear portal sessionStorage on session-end — this is the canonical session-cleanup hub now that the merge has happened. 5 source files migrated from usePortalAuthStore → useAuthStore. The PortalLayout.spec.ts mock follows. The boundaries matrix gains a single new edge (`stores → stores-portal`) replacing the deleted stores-portal/usePortalAuthStore which previously owned that cross-zone call. Adds 16 vitest specs in src/stores/__tests__/useAuthStore.spec.ts covering setUser context hydration, hasRole/hasAnyRole, lastContext localStorage persistence, resolveLandingRoute precedence (portal/organizer/super_admin/multi-role/forceContext/forbidden fallback), portalToken state, and clearAll cleanup. Test count 162 → 178 (16 new). Frontend lint + typecheck clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Crewli — Organizer SPA
Main product UI for organisation and event staff (Vue 3 + Vuexy + Vuetify). Lives in this repo; only re-copy from Vuexy when upgrading the template.
Setup
- Install dependencies:
pnpm install
- Create
.env.local:
VITE_API_URL=http://localhost:8000/api/v1
VITE_APP_NAME="Crewli Organizer"
- Dev server uses port 5174 (see
vite.config.tsor run from repo root:make app).
pnpm dev --port 5174
Port
Runs on http://localhost:5174
Production: e.g. VITE_API_URL=https://api.crewli.app/api/v1 and host the SPA at https://crewli.app (see api/.env.example for FRONTEND_APP_URL and SANCTUM_STATEFUL_DOMAINS).