Files
website/src/routes/trackers/ai/+layout.server.ts

11 lines
467 B
TypeScript

import { isOwner } from '#lib/server/owner.js';
import type { LayoutServerLoad } from './$types';
// /trackers/ai: the news tab is public; bots and usage are owner-only (their own loads call
// requireOwner, and hooks.server.ts 404s /trackers/ai/bots and /trackers/ai/usage as a backstop).
export const load: LayoutServerLoad = (event) => {
const owner = isOwner(event);
if (owner) event.setHeaders({ 'cache-control': 'private, no-store' });
return { owner };
};