learning_ai_common_plat/dashboards/admin-web/src
saravanakumardb1 a59fd92632 fix(admin-web): replace useAuth-getAccessToken with localStorage helper
The devops page was importing useAuth from '@bytelyst/react-auth'
and destructuring a non-existent 'getAccessToken' method:

  src/app/devops/page.tsx
    Type error: Module '@bytelyst/react-auth' has no exported member
    'useAuth'.
    Property 'getAccessToken' does not exist on type
    'AuthContextValue<AdminUser>'.

This had been silently masked because admin-web wasn't being built
in the consumer-repo CI workflows that just used `pnpm build`
filtered to /packages/*. Once those CI workflows switched to a
broader `pnpm build` (in the fastgap and local_llms workflow
rewrites), this dashboard build failure surfaced and blocked
EVERY consumer-repo CI run that pulls common-plat at the start
(fastgap, local_llms, jarvis_jr, etc.).

Two fixes applied to the same file:

1. Import path — useAuth lives in '@/lib/auth-context' (admin-web's
   own provider exposed via createAuthProvider), not in
   '@bytelyst/react-auth'. That package only exports the factory,
   types, and LoginResult.

2. Token access — getAccessToken is NOT on AuthContextValue. The
   canonical pattern used throughout admin-web
   (settings/security, settings/devices, debug-sessions, …) is to
   read the token directly from localStorage under the
   'admin_access_token' key. Switched to that pattern with a small
   typed helper at the top of the file.

Both changes documented in-source with a comment block so the
next agent doesn't try to re-introduce a useAuth.getAccessToken
import.
2026-05-23 15:03:02 -07:00
..
__tests__ feat(runtime): add Cowork checkpoint drill-in 2026-04-04 17:29:12 -07:00
app fix(admin-web): replace useAuth-getAccessToken with localStorage helper 2026-05-23 15:03:02 -07:00
components feat(platform): add /devops page with platform common devops package 2026-05-11 03:38:06 +00:00
lib feat(admin-web): adopt trading web deployment model with docker-compose 2026-05-11 03:24:33 +00:00
types refactor(design-tokens): improve token validator 2026-03-04 18:13:13 -08:00
instrumentation.ts fix(platform): production readiness — admin-web client bundling, config sub-path exports, stale tests 2026-03-12 16:49:15 -07:00
middleware.ts feat(admin-dashboard): add edge middleware for API route auth gating 2026-02-28 20:25:42 -08:00