import { NextResponse } from 'next/server';
import { COOKIE_NAME } from '@server/auth';
import { wrapRouteHandler } from '@server/logger/request';

async function handlePOST() {
  const response = NextResponse.json({ success: true });
  response.cookies.set(COOKIE_NAME, '', {
    httpOnly: true,
    secure: process.env.NODE_ENV === 'production',
    sameSite: 'lax',
    maxAge: 0,
    path: '/',
  });
  return response;
}

export const POST = wrapRouteHandler(handlePOST);
