Refresh me on auth state so the admin entry survives reloads
Why: store.me was only written by the forced-change gate's onDone (refreshMe sole caller), so after any page reload or a normal re-login me stayed null and the admin menu (me?.isAdmin gate in TaskSidebar/AdminZone) vanished permanently - reported repeatedly as the user-management page becoming unavailable. Evidence: vitest 100/100 pass and tsc+vite build clean after the change; grep shows refreshMe had exactly one call site before (App.tsx mustchange onDone). Impact: admins keep the system-management entry across reloads and normal logins; no behavior change for non-admins (me loads but isAdmin=false). Refs: dev task card feature/fe-me-refresh; companion Dev-repo pin bump.
This commit is contained in:
@@ -68,6 +68,10 @@ export function App() {
|
||||
|
||||
useEffect(() => {
|
||||
if (authState !== 'ok') return
|
||||
// me 回填进 store:管理入口(me?.isAdmin)与侧栏身份都消费它;此前只有
|
||||
// 改密门 onDone 调 refreshMe,登录与刷新回态后 me 恒为 null,管理员菜单
|
||||
// 在任何一次 F5 后永久消失(2026-10-12「用户管理页面不可用」根因)。
|
||||
store.refreshMe()
|
||||
store.refreshProjects()
|
||||
store.refreshProfiles()
|
||||
store.refreshPlugins()
|
||||
|
||||
Reference in New Issue
Block a user