// src/routes/api/admin/check-auth/+server.ts
import type { RequestHandler } from './$types';

export const GET: RequestHandler = async ({ cookies }) => {
  const adminAuth = cookies.get('admin-auth');
  
  if (adminAuth === 'authenticated') {
    return new Response(JSON.stringify({ authenticated: true }), {
      status: 200,
      headers: { 'Content-Type': 'application/json' }
    });
  }

  return new Response(JSON.stringify({ authenticated: false }), {
    status: 401,
    headers: { 'Content-Type': 'application/json' }
  });
};