import { NextResponse } from "next/server";
import { cookies } from "next/headers";

const REDIRECT_COOKIE = "postsync_login_redirect";

export async function GET() {
  const cookieStore = await cookies();
  const from = cookieStore.get(REDIRECT_COOKIE)?.value ?? "/dashboard";
  return NextResponse.json({ from });
}
