Bug fixes (from bugs/ directory): - Fix cross-module DB queries in 9 modules (homework, grades, parent, diagnostic, elective, proctoring, notifications, scheduling, classes) by routing through data-access functions - Fix shared/lib <-> auth circular dependency via new session.ts module - Fix divide-by-zero guard in grades data-access - Fix audit export data truncation (paginated fetch for full datasets) - Fix missing transactions in homework grading and elective lottery - Fix missing revalidatePath in course-plans actions - Fix frontend permission checks using requirePermission instead of requireAuth - Fix dashboard role routing using session.user.roles - Fix student auth pattern (migrate getDemoStudentUser to users module) - Fix ActionState return type handling in components Code quality fixes: - Remove 60+ as type assertions (replace with type guards) - Remove non-null assertions (use optional chaining or explicit checks) - Convert dynamic imports to static imports (grades, diagnostic) - Add React.cache() wrapping for read functions - Parallelize independent queries with Promise.all - Add explicit return types to 30+ arrow functions - Replace any with unknown + type guards - Fix import type for type-only imports - Add Zod validation schemas for classes and diagnostic modules - Extract duplicate code (normalizeRoleName, normalizeBcryptHash, logger IP extraction) - Add console.error to silent catch blocks - Fix permission naming consistency (exam:proctor_read -> exam:proctor:read) Architecture doc sync: - Update 004_architecture_impact_map.md and 005_architecture_data.json - Update management-modules-audit.md for P0-7 cross-module fix Moved deleted proctoring event route to deletes/ folder.
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import { Lock } from "lucide-react"
|
|
|
|
import { requireAuth } from "@/shared/lib/auth-guard"
|
|
import { PasswordChangeForm } from "@/modules/settings/components/password-change-form"
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/shared/components/ui/card"
|
|
|
|
export const dynamic = "force-dynamic"
|
|
|
|
export const metadata = {
|
|
title: "Security Settings",
|
|
}
|
|
|
|
export default async function SecuritySettingsPage() {
|
|
await requireAuth()
|
|
|
|
return (
|
|
<div className="flex h-full flex-col gap-8 p-8">
|
|
<div className="space-y-1">
|
|
<div className="flex items-center gap-2">
|
|
<Lock className="h-7 w-7 text-muted-foreground" />
|
|
<h1 className="text-3xl font-bold tracking-tight">Security</h1>
|
|
</div>
|
|
<div className="text-sm text-muted-foreground">
|
|
Manage your password and account security settings.
|
|
</div>
|
|
</div>
|
|
|
|
<div className="max-w-2xl space-y-6">
|
|
<PasswordChangeForm />
|
|
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>Security Tips</CardTitle>
|
|
<CardDescription>Best practices to keep your account safe.</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<ul className="space-y-2 text-sm text-muted-foreground">
|
|
<li>Use a unique password that you don't reuse across other sites.</li>
|
|
<li>Avoid common words, names, or sequential patterns.</li>
|
|
<li>Change your password periodically.</li>
|
|
<li>Your account will be temporarily locked after multiple failed login attempts.</li>
|
|
</ul>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|