// src/routes/admin/anmeldungen/+page.server.ts
import type { PageServerLoad } from './$types';
import { redirect } from '@sveltejs/kit';

export const load: PageServerLoad = async ({ cookies }) => {
  // Korrigiere Cookie-Name um konsistent zu sein
  const adminAuth = cookies.get('admin-auth');
  
  if (adminAuth !== 'authenticated') {
    throw redirect(303, '/admin');
  }
  
  return {
    title: 'Anmeldungen verwalten'
  };
};