Files
gpustack-ui/src
gitlawrandjialin be40692773 feat(login): add onUserFetched plugin hook
The host's access function is memoized on `initialState` and runs
exactly once per commit. Plugins that maintain identity-scoped
caches the access predicate reads from (e.g. an org context cache)
had no way to seed those caches synchronously before the caller's
`setInitialState({currentUser: ...})` fired — any post-commit hydrate
couldn't widen the predicate, leaving the sidebar in a stale view
until the next identity change.

Add `LoginPlugin.onUserFetched(userInfo, ctx)` and call it inside
`fetchUserInfo` after the server confirms identity but before
returning. Also commit the identity to `userAtom` storage here so
localStorage's identity marker is in lockstep with whatever caches
the plugin seeds — the predicate's first evaluation then sees a
consistent view rather than the prior session's data.

Errors thrown from the hook are swallowed and logged; they never
block fetchUserInfo.
2026-06-05 18:55:46 +08:00
..
2026-06-02 15:18:00 +08:00
2026-05-30 08:28:38 +08:00
2025-05-08 15:22:53 +08:00
2026-06-05 10:20:55 +08:00
2024-07-15 19:04:03 +08:00
2026-02-04 20:14:25 +08:00
2026-06-04 15:48:44 +08:00
2024-08-28 14:51:20 +08:00
2026-06-03 15:50:06 +08:00