Skip to content

Commit 39ee042

Browse files
brkalowclaude
andauthored
fix(backend): use redirect:'manual' in frontend API proxy fetch (#8186)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent abbc6c4 commit 39ee042

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': patch
3+
---
4+
5+
Fix frontend API proxy following redirects server-side instead of passing them to the browser. The proxy's `fetch()` call now uses `redirect: 'manual'` so that 3xx responses from FAPI (e.g. after OAuth callbacks) are returned to the client as-is, matching standard HTTP proxy behavior.

packages/backend/src/proxy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export async function clerkFrontendApiProxy(request: Request, options?: Frontend
278278
const fetchOptions: RequestInit = {
279279
method: request.method,
280280
headers,
281+
redirect: 'manual',
281282
// @ts-expect-error - duplex is required for streaming bodies but not in all TS definitions
282283
duplex: hasBody ? 'half' : undefined,
283284
};

0 commit comments

Comments
 (0)