continued the kita-planer
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user