import { NextResponse } from "next/server";
import { destroySession } from "@/lib/auth/session";
import { apiRouteErrorResponse } from "@/lib/auth/api";

export async function POST() {
  try {
    await destroySession();
    return NextResponse.json({ success: true });
  } catch (error) {
    return apiRouteErrorResponse(error, "auth/logout");
  }
}