import { NextResponse } from "next/server";
import { clearBrowserSession } from "@/lib/threads-browser";

export async function POST() {
  try {
    const result = await clearBrowserSession();
    return NextResponse.json(result);
  } catch (error) {
    const message = error instanceof Error ? error.message : "清除 session 失敗";
    return NextResponse.json({ cleared: false, message }, { status: 500 });
  }
}