From 088d318e51f0ffafc042fd48852284c4eb14ae8a Mon Sep 17 00:00:00 2001 From: janpeter visser Date: Fri, 24 Apr 2026 16:34:04 +0200 Subject: [PATCH] fix: ST-609 demo-check toegevoegd aan POST /api/stories/:id/log en POST /api/todos --- app/api/stories/[id]/log/route.ts | 3 +++ app/api/todos/route.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/api/stories/[id]/log/route.ts b/app/api/stories/[id]/log/route.ts index d88dca4..baf4ba6 100644 --- a/app/api/stories/[id]/log/route.ts +++ b/app/api/stories/[id]/log/route.ts @@ -28,6 +28,9 @@ export async function POST( if ('error' in auth) { return Response.json({ error: auth.error }, { status: auth.status }) } + if (auth.isDemo) { + return Response.json({ error: 'Niet beschikbaar in demo-modus' }, { status: 403 }) + } const { id: storyId } = await params diff --git a/app/api/todos/route.ts b/app/api/todos/route.ts index 2a65b32..357edf7 100644 --- a/app/api/todos/route.ts +++ b/app/api/todos/route.ts @@ -11,6 +11,9 @@ export async function POST(request: Request) { if ('error' in auth) { return Response.json({ error: auth.error }, { status: auth.status }) } + if (auth.isDemo) { + return Response.json({ error: 'Niet beschikbaar in demo-modus' }, { status: 403 }) + } const body = await request.json().catch(() => null) const parsed = bodySchema.safeParse(body)