import { NextResponse } from "next/server"
import { cookies } from "next/headers"

export async function POST(request: Request) {
  const cookieStore = await cookies()

  cookieStore.delete("mock-session")
  cookieStore.delete("fastapi-session")
  cookieStore.delete("auth_token")
  cookieStore.delete("auth_user")

  const url = new URL("/login", request.url)
  return NextResponse.redirect(url, { status: 303 })
}

export async function GET(request: Request) {
  return POST(request)
}