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

export async function GET() {
  try {
    const status = await getStoredSessionStatus();
    return NextResponse.json(status);
  } catch (error) {
    const message = error instanceof Error ? error.message : "檢查 session 失敗";
    return NextResponse.json({ valid: false, message }, { status: 500 });
  }
}