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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user