import { NextResponse } from "next/server";
import { clearSessionCookie } from "@/lib/auth/session";
import { buildAppUrl } from "@/lib/http/url";

export async function POST(request: Request) {
  const response = NextResponse.redirect(buildAppUrl(request, "/login", { logged_out: "1" }));

  clearSessionCookie(response);

  return response;
}
