import type { APIRoute } from 'astro';
import { clearSessionCookie, CSRF_COOKIE, clearCookie } from '../../../lib/session';

export const POST: APIRoute = async () => {
  const headers = new Headers();
  headers.append('Set-Cookie', clearSessionCookie());
  headers.append('Set-Cookie', clearCookie(CSRF_COOKIE));
  return new Response(JSON.stringify({ ok: true }), { status: 200, headers });
};
