// Author: Simon-Pierre Boucher // Contact: contact@spboucher.ai // Project: chat.spboucher.ai import { NextResponse } from "next/server"; import { cookies } from "next/headers"; import { destroySession, SESSION_COOKIE } from "@/lib/auth/auth"; export const runtime = "nodejs"; export async function POST() { const jar = await cookies(); destroySession(jar.get(SESSION_COOKIE)?.value); const res = NextResponse.json({ ok: true }); res.headers.set( "Set-Cookie", `${SESSION_COOKIE}=; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=0` ); return res; }