Added comprehensive authentication and authorization system: Authentication System: - Better Auth integration with session management - Login/logout pages and API routes - Middleware for route protection - Auth utilities and client libraries User Management: - User list, detail, and invite pages - User API endpoints (CRUD operations) - Session management for users - Profile settings page Role-Based Access Control: - Role management pages (list, create, edit) - Permission system with granular controls - Role assignment to users - Role API endpoints Admin Features: - Audit log page for tracking system events - Admin settings page - Audit service for logging user actions Additional Features: - Quotes management pages and components - SalesBldr API integration - Email service for notifications Configuration & Documentation: - Updated docker-compose.yml - MCP server configuration (mcp.json) - CVE-2025-55182 security review documentation - Standards guide and PRD documents - Re-enabling authentication documentation Database Migrations: - 012: Auth tables (users, sessions, accounts, verifications) - 013: Role tables (roles, permissions, role_permissions, user_roles) - 014: Admin settings table UI Updates: - Updated dashboard layout - Enhanced app layout with auth integration
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
import { redirect } from "next/navigation";
|
|
import { getSession } from "@/lib/auth-utils";
|
|
import { TwoFactorSetup } from "@/components/settings/two-factor-setup";
|
|
import { ActiveSessions } from "@/components/settings/active-sessions";
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
|
|
|
export default async function SecuritySettingsPage() {
|
|
const session = await getSession();
|
|
|
|
if (!session) {
|
|
redirect("/auth/sign-in");
|
|
}
|
|
|
|
return (
|
|
<div className="container mx-auto py-8 px-4 max-w-2xl">
|
|
<div className="mb-8">
|
|
<h1 className="text-3xl font-bold">Security Settings</h1>
|
|
<p className="text-muted-foreground mt-2">
|
|
Manage your security preferences
|
|
</p>
|
|
</div>
|
|
|
|
<div className="space-y-6">
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>Two-Factor Authentication</CardTitle>
|
|
<CardDescription>
|
|
Add an extra layer of security to your account
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<TwoFactorSetup />
|
|
</CardContent>
|
|
</Card>
|
|
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>Active Sessions</CardTitle>
|
|
<CardDescription>
|
|
Manage your active sessions across devices
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<ActiveSessions userId={session.user.id} />
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|