Files
sendewerk/src/routes/heinzlive/[token]/state/+server.ts
T
2026-10-23 07:47:27 +02:00

13 lines
624 B
TypeScript

import { error, json } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { getPresentationChannelView, presentationChannelAccess } from '#lib/server/live.js';
export const GET: RequestHandler = ({ params, cookies }) => {
const accessKey = cookies.get(`sendewerk-output-${params.token}`) ?? '';
if (!presentationChannelAccess(params.token, accessKey))
error(404, 'Präsentationsausgabe nicht gefunden');
const view = getPresentationChannelView(params.token);
if (!view) error(404, 'Präsentationsausgabe nicht gefunden');
return json(view, { headers: { 'Cache-Control': 'no-store' } });
};