continued the kita-planer

This commit is contained in:
t.indorf
2026-05-08 14:32:14 +02:00
parent b686e714ff
commit 7aff691803
85 changed files with 9434 additions and 588 deletions
+4 -2
View File
@@ -34,7 +34,7 @@ export async function getSession(): Promise<Session | null> {
export async function requireSession(): Promise<AuthenticatedSession> {
const session = await auth();
if (!session?.user) {
if (!session?.user?.id) {
redirect("/login");
}
return session as AuthenticatedSession;
@@ -81,7 +81,9 @@ export async function requireRole(
// interne Helfer
// ---------------------------------------------------------------------
async function consentCheck(userId: string): Promise<boolean> {
async function consentCheck(userId: string | undefined): Promise<boolean> {
if (!userId) return false;
// Lazy-Import, damit `auth-utils` selbst Edge-kompatibel bleibt
// (Prisma läuft nur in Node-Runtime).
const { prisma } = await import("@/lib/prisma");