[PULSE-50] Organizations rename, remove Tools page, post-login profile fetch, welcome page UX #18

Merged
uz1mani merged 11 commits from staging into main 2026-02-09 08:59:05 +00:00
7 changed files with 89 additions and 99 deletions
Showing only changes of commit 0f7e644f17 - Show all commits

View File

@@ -53,6 +53,20 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
localStorage.setItem('user', JSON.stringify(userData))
setUser(userData)
router.refresh()
// * Fetch full profile (including display_name) so header shows correct name without page refresh
apiRequest<User>('/auth/user/me')
.then((fullProfile) => {
setUser((prev) => {
const merged = {
...fullProfile,
org_id: prev?.org_id ?? fullProfile.org_id,
role: prev?.role ?? fullProfile.role,
}
localStorage.setItem('user', JSON.stringify(merged))
return merged
})
})
.catch((e) => console.error('Failed to fetch full profile after login', e))
}
const logout = useCallback(async () => {