diff --git a/components/settings/ProfileSettings.tsx b/components/settings/ProfileSettings.tsx index 6b1a4dd..6713140 100644 --- a/components/settings/ProfileSettings.tsx +++ b/components/settings/ProfileSettings.tsx @@ -4,7 +4,7 @@ import { useAuth } from '@/lib/auth/context' import { ProfileSettings as SharedProfileSettings } from '@ciphera-net/ui' import api from '@/lib/api/client' import { deriveAuthKey } from '@/lib/crypto/password' -import { deleteAccount, getUserSessions, revokeSession, updateUserPreferences } from '@/lib/api/user' +import { deleteAccount, getUserSessions, revokeSession, updateUserPreferences, updateDisplayName } from '@/lib/api/user' import { setup2FA, verify2FA, disable2FA, regenerateRecoveryCodes } from '@/lib/api/2fa' export default function ProfileSettings() { @@ -37,6 +37,7 @@ export default function ProfileSettings() { { + return apiRequest('/auth/user/display-name', { + method: 'PUT', + body: JSON.stringify({ display_name: displayName }), + }) +} diff --git a/lib/auth/context.tsx b/lib/auth/context.tsx index daa50b5..edfd0a8 100644 --- a/lib/auth/context.tsx +++ b/lib/auth/context.tsx @@ -10,9 +10,17 @@ import { getUserOrganizations, switchContext } from '@/lib/api/organization' interface User { id: string email: string + display_name?: string totp_enabled: boolean org_id?: string role?: string + preferences?: { + email_notifications?: { + new_file_received: boolean + file_downloaded: boolean + security_alerts: boolean + } + } } interface AuthContextType { diff --git a/package-lock.json b/package-lock.json index 2c4cbb3..944e9a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "pulse-frontend", "version": "0.1.3", "dependencies": { - "@ciphera-net/ui": "^0.0.46", + "@ciphera-net/ui": "^0.0.47", "@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.46", - "resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.46/852ce8d0289505c3d3f625a0f076bfb3fb03ef9f", - "integrity": "sha512-ZYu1u07B1ROYFYFznWQk2sShSqhFpPKNPCBUjqqElTP5hMYX0jVAnVIzqXUugdLl7E8luwvL6Lx+dOaN4oPORg==", + "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==", "dependencies": { "@radix-ui/react-icons": "^1.3.0", "clsx": "^2.1.0", diff --git a/package.json b/package.json index b52dad8..e548d6f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@ciphera-net/ui": "^0.0.46", + "@ciphera-net/ui": "^0.0.47", "@ducanh2912/next-pwa": "^10.2.9", "axios": "^1.13.2", "country-flag-icons": "^1.6.4",