Skip to content

fix: sign-in render crash in dev, and allow the tunnel host in next dev - #13

Merged
erikgoins merged 1 commit into
mainfrom
fix/sign-in-ssr-dev-origins
Nov 18, 2026
Merged

erikgoins merged 1 commit into
mainfrom
fix/sign-in-ssr-dev-origins

Conversation

@erikgoins

Copy link
Copy Markdown
Contributor
  • Sign-in crash in dev. safeNext read window.location during the sign-in form's render, so next dev threw window is not defined and fell back to client rendering. The form now calls it in the submit handler, and safeNext uses a fixed origin when window does not exist. New unit test apps/web/src/lib/api.test.ts fails without the fix.
  • Tunnel in dev. next dev blocked /_next/hmr from the cloudflared host. next.config.ts now adds the BETTER_AUTH_URL host to allowedDevOrigins (dev only).

Checks: lint, typecheck, 404 unit tests, 34 E2E tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T7sHyaEvdoSPjkLy7T1aaz

safeNext read window.location during the sign-in form's render, so next dev
threw "window is not defined" and fell back to client rendering. The form now
calls it in the submit handler, and safeNext uses a fixed origin when window
does not exist (it returns only a path). A Node unit test guards it.

next dev blocks its dev resources for hosts other than localhost, which broke
the app behind a cloudflared tunnel (needed for GitHub App setup). next.config
now allows the BETTER_AUTH_URL host in dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7sHyaEvdoSPjkLy7T1aaz
Signed-off-by: Erik Goins <erikgoins@gmail.com>
@erikgoins
erikgoins merged commit f221804 into main Nov 18, 2026
3 checks passed
@erikgoins
erikgoins deleted the fix/sign-in-ssr-dev-origins branch November 18, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant