chore: ciphera-ui 0.0.48, fetch full profile including display_name on init
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -100,6 +100,15 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
if (session) {
|
||||
setUser(session)
|
||||
localStorage.setItem('user', JSON.stringify(session))
|
||||
// * Fetch full profile (including display_name) from API; preserve org_id/role from session
|
||||
try {
|
||||
const userData = await apiRequest<User>('/auth/user/me')
|
||||
const merged = { ...userData, org_id: session.org_id, role: session.role }
|
||||
setUser(merged)
|
||||
localStorage.setItem('user', JSON.stringify(merged))
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch full profile', e)
|
||||
}
|
||||
} else {
|
||||
// * Session invalid/expired
|
||||
localStorage.removeItem('user')
|
||||
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -8,7 +8,7 @@
|
||||
"name": "pulse-frontend",
|
||||
"version": "0.1.3",
|
||||
"dependencies": {
|
||||
"@ciphera-net/ui": "^0.0.47",
|
||||
"@ciphera-net/ui": "^0.0.48",
|
||||
"@ducanh2912/next-pwa": "^10.2.9",
|
||||
"axios": "^1.13.2",
|
||||
"country-flag-icons": "^1.6.4",
|
||||
@@ -1467,9 +1467,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@ciphera-net/ui": {
|
||||
"version": "0.0.47",
|
||||
"resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.47/515f5980070b669351583081909e684cd4e1ad04",
|
||||
"integrity": "sha512-Gn2Qgy7p+Qo0Ko92nVs3RbQGQHDcolm+EHVCGzRDyFiZXMW7mgV+yFoUOxdq2sOqcbiIiZOZU+r59inXk1Xe2g==",
|
||||
"version": "0.0.48",
|
||||
"resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.48/20eedc6319567fff80530d865ebbed6e6f784dab",
|
||||
"integrity": "sha512-kDrGV7tzAjeiz7MtK5G81iY08Zg4NxHTlDNkH5/Pkl2aSpyraf04/J/pGshChjdXMdioXrJA7JU8YH+GlI1LfA==",
|
||||
"dependencies": {
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"clsx": "^2.1.0",
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"type-check": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ciphera-net/ui": "^0.0.47",
|
||||
"@ciphera-net/ui": "^0.0.48",
|
||||
"@ducanh2912/next-pwa": "^10.2.9",
|
||||
"axios": "^1.13.2",
|
||||
"country-flag-icons": "^1.6.4",
|
||||
|
||||
Reference in New Issue
Block a user