- C1: Disable Swagger UI in production (env gate) - M1+M2: Add Helmet.js for security headers (CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy) and remove X-Powered-By - H2: Add @nestjs/throttler rate limiting (5 req/min on login/register) - M4: Remove orgSchema from JWT payload and client-side storage; tenant middleware now resolves schema from orgId via cached DB lookup - L1: Fix Chatwoot user identification (read from auth store on ready) - Remove schemaName from frontend Organization type and UI displays Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
128 lines
4.6 KiB
TypeScript
128 lines
4.6 KiB
TypeScript
import {
|
|
Title, Text, Card, Stack, Group, SimpleGrid, Badge, ThemeIcon, Divider,
|
|
} from '@mantine/core';
|
|
import {
|
|
IconBuilding, IconUser, IconUsers, IconSettings, IconShieldLock,
|
|
IconCalendar,
|
|
} from '@tabler/icons-react';
|
|
import { useAuthStore } from '../../stores/authStore';
|
|
|
|
export function SettingsPage() {
|
|
const { user, currentOrg } = useAuthStore();
|
|
|
|
return (
|
|
<Stack>
|
|
<div>
|
|
<Title order={2}>Settings</Title>
|
|
<Text c="dimmed" size="sm">Organization and account settings</Text>
|
|
</div>
|
|
|
|
<SimpleGrid cols={{ base: 1, md: 2 }}>
|
|
{/* Organization Info */}
|
|
<Card withBorder padding="lg">
|
|
<Group mb="md">
|
|
<ThemeIcon color="blue" variant="light" size={40} radius="md">
|
|
<IconBuilding size={24} />
|
|
</ThemeIcon>
|
|
<div>
|
|
<Text fw={600} size="lg">Organization</Text>
|
|
<Text c="dimmed" size="sm">Current organization details</Text>
|
|
</div>
|
|
</Group>
|
|
<Stack gap="xs">
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">Name</Text>
|
|
<Text size="sm" fw={500}>{currentOrg?.name || 'N/A'}</Text>
|
|
</Group>
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">Your Role</Text>
|
|
<Badge variant="light">{currentOrg?.role || 'N/A'}</Badge>
|
|
</Group>
|
|
</Stack>
|
|
</Card>
|
|
|
|
{/* User Profile */}
|
|
<Card withBorder padding="lg">
|
|
<Group mb="md">
|
|
<ThemeIcon color="green" variant="light" size={40} radius="md">
|
|
<IconUser size={24} />
|
|
</ThemeIcon>
|
|
<div>
|
|
<Text fw={600} size="lg">Your Profile</Text>
|
|
<Text c="dimmed" size="sm">Account information</Text>
|
|
</div>
|
|
</Group>
|
|
<Stack gap="xs">
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">Name</Text>
|
|
<Text size="sm" fw={500}>{user?.firstName} {user?.lastName}</Text>
|
|
</Group>
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">Email</Text>
|
|
<Text size="sm" fw={500}>{user?.email}</Text>
|
|
</Group>
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">User ID</Text>
|
|
<Text size="sm" ff="monospace" c="dimmed">{user?.id?.slice(0, 8)}...</Text>
|
|
</Group>
|
|
</Stack>
|
|
</Card>
|
|
|
|
{/* Security */}
|
|
<Card withBorder padding="lg">
|
|
<Group mb="md">
|
|
<ThemeIcon color="red" variant="light" size={40} radius="md">
|
|
<IconShieldLock size={24} />
|
|
</ThemeIcon>
|
|
<div>
|
|
<Text fw={600} size="lg">Security</Text>
|
|
<Text c="dimmed" size="sm">Authentication and access</Text>
|
|
</div>
|
|
</Group>
|
|
<Stack gap="xs">
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">Authentication</Text>
|
|
<Badge color="green" variant="light">Active Session</Badge>
|
|
</Group>
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">Two-Factor Auth</Text>
|
|
<Badge color="gray" variant="light">Not Configured</Badge>
|
|
</Group>
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">OAuth Providers</Text>
|
|
<Badge color="gray" variant="light">None Linked</Badge>
|
|
</Group>
|
|
</Stack>
|
|
</Card>
|
|
|
|
{/* System Info */}
|
|
<Card withBorder padding="lg">
|
|
<Group mb="md">
|
|
<ThemeIcon color="violet" variant="light" size={40} radius="md">
|
|
<IconSettings size={24} />
|
|
</ThemeIcon>
|
|
<div>
|
|
<Text fw={600} size="lg">System</Text>
|
|
<Text c="dimmed" size="sm">Platform information</Text>
|
|
</div>
|
|
</Group>
|
|
<Stack gap="xs">
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">Platform</Text>
|
|
<Text size="sm" fw={500}>HOA LedgerIQ</Text>
|
|
</Group>
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">Version</Text>
|
|
<Badge variant="light">2026.03.10</Badge>
|
|
</Group>
|
|
<Group justify="space-between">
|
|
<Text size="sm" c="dimmed">API</Text>
|
|
<Text size="sm" ff="monospace" c="dimmed">/api/docs</Text>
|
|
</Group>
|
|
</Stack>
|
|
</Card>
|
|
</SimpleGrid>
|
|
</Stack>
|
|
);
|
|
}
|