[as frontend] device-id 추가후 테스트
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user