29 lines
884 B
TypeScript
29 lines
884 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
const API_BASE_URL =
|
|
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
|
|
|
|
export async function POST(req: Request) {
|
|
try {
|
|
const body = await req.json();
|
|
|
|
const res = await fetch(`${API_BASE_URL}/api/auth/beta/signup`, {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify(body),
|
|
cache: "no-store",
|
|
});
|
|
|
|
// Always return ok=true (matches your server behavior)
|
|
if (!res.ok) {
|
|
// Optional: log server response for debugging
|
|
const text = await res.text().catch(() => "");
|
|
console.error("beta-signup proxy failed:", res.status, text);
|
|
}
|
|
|
|
return NextResponse.json({ ok: true });
|
|
} catch (e) {
|
|
console.error("beta-signup proxy error:", e);
|
|
return NextResponse.json({ ok: true }); // keep “no enumeration”
|
|
}
|
|
} |