fix(oauth): declare searchParams in register-session POST handler

Missing declaration caused a ReferenceError -> 500 HTML response instead
of JSON when clients called POST .../register-session.
This commit is contained in:
alfep
2026-08-05 11:40:51 +07:00
committed by decolua
parent 86131b9ca4
commit 948dd8f89b

View File

@@ -254,6 +254,7 @@ export async function POST(request, { params }) {
if (action === "register-session") {
// Register proxy session out of URL query (state) + body (codeVerifier).
// Zed's codeVerifier encodes the RSA private key — must stay out of URL/logs.
const searchParams = new URL(request.url).searchParams;
const state = searchParams.get("state") || body?.state;
if (!state) return NextResponse.json({ error: "Missing state" }, { status: 400 });
let ok = false;