fix(auth): add CORS headers to BetterAuth raw HTTP handler #112

Merged
jason.woltje merged 1 commits from fix/auth-cors-headers into main 2026-03-15 16:47:28 +00:00
Owner

Auth handler uses reply.hijack() which bypasses NestJS CORS. Now manually sets CORS headers and handles OPTIONS preflight before delegating to BetterAuth.

Auth handler uses reply.hijack() which bypasses NestJS CORS. Now manually sets CORS headers and handles OPTIONS preflight before delegating to BetterAuth.
jason.woltje added 1 commit 2026-03-15 16:47:21 +00:00
fix(auth): add CORS headers to BetterAuth raw HTTP handler
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
394f4f9fab
The auth handler uses Fastify's onRequest hook with reply.hijack(),
which bypasses all NestJS middleware including CORS. Manually set
Access-Control-Allow-* headers on the raw response and handle OPTIONS
preflight before delegating to BetterAuth's node handler.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jason.woltje merged commit 049bb719e8 into main 2026-03-15 16:47:28 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#112