import { NextRequest, NextResponse } from "next/server";

export async function GET(req: NextRequest) {
  const searchParams = req.nextUrl.searchParams;
  const success = searchParams.get("success");
  const lang = "en";

  // Redirect to the Stripe Connect settings page
  const redirectUrl = `${process.env.NEXT_PUBLIC_APP_URL || "http://localhost:9000"}/${lang}/dashboard/settings/stripe-connect${success ? "?connected=true" : ""}`;
  return NextResponse.redirect(redirectUrl);
}
