|
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. |
|---|
|
|
| server/SHServ/Integrations/GAuth/AuthControllerTrait.php |
|---|
| webclient/src/api/auth.js 0 → 100644 |
|---|
| webclient/src/api/client.js |
|---|
| webclient/src/api/http.js |
|---|
| webclient/src/app/main.js |
|---|
| webclient/src/components/layout/AppShell.vue |
|---|
| webclient/src/components/layout/__tests__/AppShell.spec.js |
|---|
| webclient/src/composables/usePermission.js 0 → 100644 |
|---|
| webclient/src/features/auth/pages/LoginPage.vue 0 → 100644 |
|---|
| webclient/src/router/index.js |
|---|
| webclient/src/router/routes.js |
|---|
| webclient/src/stores/auth.js 0 → 100644 |
|---|
| webclient/src/test/mocks/handlers.js |
|---|