Phase 4: Vue client auth store, Bearer token injection, router guards, login page
Server:
- AuthControllerTrait now supports both session and Bearer token auth
  (resolves user from Authorization: Bearer header via shserv_sessions)

Vue client:
- Add api/auth.js module for access token management
- Inject Authorization: Bearer header in http.js
- Handle 401 in client.js: clear token + redirect to /auth/login
- New Pinia auth store (stores/auth.js): init, refreshToken, logout, hasPermission
- New usePermission composable
- Router guards: redirect unauthenticated to /login, permission-based route blocking
- New LoginPage.vue with gnexus-auth login button
- AppShell: conditional nav items by permission, user bar with logout
- main.js: initialize auth before mounting app
- MSW mocks: /auth/me, /auth/logout, /auth/refresh
- Fix AppShell.spec.js for Pinia + router setup

All 167 tests pass.
1 parent 0552de9 commit ac97fa4821fc377d1f093f2df19c482e99a62555
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 14 hours ago
Showing 13 changed files
View
server/SHServ/Integrations/GAuth/AuthControllerTrait.php
View
webclient/src/api/auth.js 0 → 100644
View
webclient/src/api/client.js
View
webclient/src/api/http.js
View
webclient/src/app/main.js
View
webclient/src/components/layout/AppShell.vue
View
webclient/src/components/layout/__tests__/AppShell.spec.js
View
webclient/src/composables/usePermission.js 0 → 100644
View
webclient/src/features/auth/pages/LoginPage.vue 0 → 100644
View
webclient/src/router/index.js
View
webclient/src/router/routes.js
View
webclient/src/stores/auth.js 0 → 100644
View
webclient/src/test/mocks/handlers.js