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) {
|
if (session) {
|
||||||
setUser(session)
|
setUser(session)
|
||||||
localStorage.setItem('user', JSON.stringify(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 {
|
} else {
|
||||||
// * Session invalid/expired
|
// * Session invalid/expired
|
||||||
localStorage.removeItem('user')
|
localStorage.removeItem('user')
|
||||||
|
|||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -8,7 +8,7 @@
|
|||||||
"name": "pulse-frontend",
|
"name": "pulse-frontend",
|
||||||
"version": "0.1.3",
|
"version": "0.1.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ciphera-net/ui": "^0.0.47",
|
"@ciphera-net/ui": "^0.0.48",
|
||||||
"@ducanh2912/next-pwa": "^10.2.9",
|
"@ducanh2912/next-pwa": "^10.2.9",
|
||||||
"axios": "^1.13.2",
|
"axios": "^1.13.2",
|
||||||
"country-flag-icons": "^1.6.4",
|
"country-flag-icons": "^1.6.4",
|
||||||
@@ -1467,9 +1467,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ciphera-net/ui": {
|
"node_modules/@ciphera-net/ui": {
|
||||||
"version": "0.0.47",
|
"version": "0.0.48",
|
||||||
"resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.47/515f5980070b669351583081909e684cd4e1ad04",
|
"resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.48/20eedc6319567fff80530d865ebbed6e6f784dab",
|
||||||
"integrity": "sha512-Gn2Qgy7p+Qo0Ko92nVs3RbQGQHDcolm+EHVCGzRDyFiZXMW7mgV+yFoUOxdq2sOqcbiIiZOZU+r59inXk1Xe2g==",
|
"integrity": "sha512-kDrGV7tzAjeiz7MtK5G81iY08Zg4NxHTlDNkH5/Pkl2aSpyraf04/J/pGshChjdXMdioXrJA7JU8YH+GlI1LfA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/react-icons": "^1.3.0",
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
"clsx": "^2.1.0",
|
"clsx": "^2.1.0",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ciphera-net/ui": "^0.0.47",
|
"@ciphera-net/ui": "^0.0.48",
|
||||||
"@ducanh2912/next-pwa": "^10.2.9",
|
"@ducanh2912/next-pwa": "^10.2.9",
|
||||||
"axios": "^1.13.2",
|
"axios": "^1.13.2",
|
||||||
"country-flag-icons": "^1.6.4",
|
"country-flag-icons": "^1.6.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user