Skip to content

Commit 2ca66b0

Browse files
hakyungjinclaude
andcommitted
debug: add detailed request/response logging to API proxy
Add console.log for request body and response status/body to debug 403 Forbidden errors during profile setup flow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent 4d3a4c4 commit 2ca66b0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/web/app/api/[...path]/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ async function proxyRequest(
8282
const contentType = request.headers.get('content-type');
8383
if (contentType?.includes('application/json')) {
8484
body = await request.json();
85+
console.log('[API Proxy] Request body:', body);
8586
} else if (contentType?.includes('multipart/form-data')) {
8687
body = await request.formData();
8788
} else {
@@ -112,12 +113,16 @@ async function proxyRequest(
112113

113114
if (responseContentType?.includes('application/json')) {
114115
responseBody = await response.json();
116+
console.log('[API Proxy] Response status:', response.status);
117+
console.log('[API Proxy] Response body:', responseBody);
115118
return NextResponse.json(responseBody, {
116119
status: response.status,
117120
headers: responseHeaders,
118121
});
119122
} else {
120123
responseBody = await response.text();
124+
console.log('[API Proxy] Response status:', response.status);
125+
console.log('[API Proxy] Response body:', responseBody);
121126
return new NextResponse(responseBody, {
122127
status: response.status,
123128
headers: responseHeaders,

0 commit comments

Comments
 (0)