From 3681eec9eb0ebeb130f3684a8142b3a96c437061 Mon Sep 17 00:00:00 2001 From: Aaron Nelson Date: Sun, 26 Apr 2026 15:48:40 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20proxy=20=E2=80=94=20auth=20routes=20bypas?= =?UTF-8?q?s=20/api/=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/[...slug]/route.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/[...slug]/route.ts b/app/api/[...slug]/route.ts index 43e9ea4..aadec6b 100644 --- a/app/api/[...slug]/route.ts +++ b/app/api/[...slug]/route.ts @@ -7,20 +7,20 @@ async function handler( { params }: { params: Promise<{ slug: string[] }> } ) { const { slug } = await params; - const path = '/api/' + slug.join('/'); + const slugPath = slug.join('/'); + + // Auth routes go directly without /api/ prefix + const isAuth = slugPath.startsWith('auth/'); + const path = isAuth ? `/${slugPath}` : `/api/${slugPath}`; + const url = `${API_BASE}${path}${request.nextUrl.search}`; const headers = new Headers(); - - // Forward content-type exactly (includes multipart boundary) const contentType = request.headers.get('content-type'); if (contentType) headers.set('content-type', contentType); - - // Forward session cookie const cookie = request.headers.get('cookie'); if (cookie) headers.set('cookie', cookie); - // Forward body let body: BodyInit | undefined; if (request.method !== 'GET' && request.method !== 'HEAD') { body = await request.arrayBuffer();