preserve auth headers in json proxies

This commit is contained in:
2569718930@qq.com
2026-06-11 14:04:17 +08:00
parent 5b65da6049
commit d314aa04d7
8 changed files with 59 additions and 16 deletions
@@ -2,6 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
import {
applyAuthResponseCookies,
buildBackendRequestHeaders,
buildJsonBackendRequestHeaders,
} from "@/lib/backend-auth";
import { buildProxyExceptionResponse } from "@/lib/api-proxy";
import { requireOpsProxyAuth } from "@/lib/ops-proxy-auth";
@@ -24,10 +25,7 @@ export async function POST(req: NextRequest) {
const body = await req.text();
const res = await fetch(`${API_BASE}/api/ops/users/grant-points`, {
method: "POST",
headers: {
...auth.headers,
"Content-Type": "application/json",
},
headers: buildJsonBackendRequestHeaders(auth.headers),
body,
cache: "no-store",
});