[as frontend] device-id 추가후 테스트

This commit is contained in:
2026-07-08 10:45:53 +09:00
parent 774f3a5507
commit c41a7bf3d3
2 changed files with 43 additions and 0 deletions
+15
View File
@@ -20,6 +20,16 @@ async function handler(
"Content-Type": "application/json",
"X-Site-Id": SITE_ID,
};
// X-Device-Id 중계 로직 (헤더 또는 쿠키에서 획득)
const deviceId =
request.headers.get("x-device-id") ||
request.headers.get("X-Device-Id") ||
cookieStore.get("device-id")?.value;
if (deviceId) {
headers["X-Device-Id"] = deviceId;
}
let body = {};
const isRefreshHandler = params.url.includes("refresh");
@@ -45,6 +55,11 @@ async function handler(
});
if (!result.ok) {
console.error(`[BFF Proxy Error] Backend returned status ${result.status} for ${params.url.join("/")}`);
try {
const errorText = await result.text();
console.error(`[BFF Proxy Error Body] ${errorText}`);
} catch (err) {}
return NextResponse.json(
{ message: "Invalid Credentials" },
{ status: 401 },