- ST-601/602: loading skeletons en error boundary - ST-603: Sonner toasts op alle CRUD-operaties - ST-604: DemoTooltip op uitgeschakelde knoppen - ST-605: KeyboardSensor dnd-kit, Escape sluit modals - ST-606: min-width banner < 1024px - ST-607: WCAG AA aria-labels en skip link - ST-608: rate limiting login (10/min) en registratie (5/uur) - ST-609: security integratietests cross-user toegang (7 tests) - ST-610: GitHub Actions CI/CD workflow - ST-611: README met quickstart, deployment en API-docs - ST-612: Lars-flow acceptatiechecklist - fix: settings toont gebruikersnaam i.p.v. interne id - fix: seed idempotent, testdata altijd gekoppeld aan demo-gebruiker Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.9 KiB
TypeScript
44 lines
1.9 KiB
TypeScript
import { cookies } from 'next/headers'
|
|
import { getIronSession } from 'iron-session'
|
|
import { SessionData, sessionOptions } from '@/lib/session'
|
|
import { prisma } from '@/lib/prisma'
|
|
import { RoleManager } from '@/components/settings/role-manager'
|
|
import Link from 'next/link'
|
|
|
|
export default async function SettingsPage() {
|
|
const session = await getIronSession<SessionData>(await cookies(), sessionOptions)
|
|
|
|
const [user, userRoles] = await Promise.all([
|
|
prisma.user.findUnique({ where: { id: session.userId }, select: { username: true } }),
|
|
prisma.userRole.findMany({ where: { user_id: session.userId } }),
|
|
])
|
|
const currentRoles = userRoles.map(r => r.role as string)
|
|
|
|
return (
|
|
<div className="p-6 max-w-2xl mx-auto w-full space-y-6">
|
|
<h1 className="text-xl font-medium text-foreground">Instellingen</h1>
|
|
|
|
<div className="bg-surface-container-low border border-border rounded-xl p-5 space-y-3">
|
|
<h2 className="text-sm font-medium text-foreground">Account</h2>
|
|
<p className="text-sm text-muted-foreground">
|
|
Ingelogd als <span className="text-foreground font-medium">{user?.username ?? session.userId}</span>
|
|
{session.isDemo && <span className="ml-2 text-warning text-xs">(demo)</span>}
|
|
</p>
|
|
</div>
|
|
|
|
<RoleManager currentRoles={currentRoles} isDemo={session.isDemo ?? false} />
|
|
|
|
<div className="bg-surface-container-low border border-border rounded-xl p-5 space-y-3">
|
|
<div className="flex items-center justify-between">
|
|
<h2 className="text-sm font-medium text-foreground">API Tokens</h2>
|
|
<Link href="/settings/tokens" className="text-xs text-primary hover:underline">
|
|
Beheren →
|
|
</Link>
|
|
</div>
|
|
<p className="text-sm text-muted-foreground">
|
|
Gebruik API tokens om Scrum4Me te koppelen aan Claude Code.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|