PR #282 · pramaan-io/pramaan-app · merged 2026-06-10
Sign-in bounces back to localhost.
The browser came in on the public host. The server sent it back to localhost.
The proxy knew. The server didn't.
The fix — Trust the forwarded host, not the request URL.
sequenceDiagram autonumber participant browser as Browser participant tunnel as Tunnel / Proxy participant nextjs as Next.js proxy.ts browser->>tunnel: GET app.com/sign-in tunnel->>nextjs: GET /sign-in + x-forwarded-host nextjs->>nextjs: getPublicRequestOrigin() reads the label nextjs->>browser: Location: https://app.com/auth
| File | ± |
|---|---|
src/proxy.ts ★ | +39 −6 |
tests/unit/proxy.test.ts | +87 −8 |