Skip to content

fix(api): keep the port in the GitHub OAuth callback URL - #222

Merged
themightychris merged 1 commit into
developfrom
fix/oauth-callback-port
Oct 14, 2026
Merged

themightychris merged 1 commit into
developfrom
fix/oauth-callback-port

Conversation

@themightychris

Copy link
Copy Markdown
Member

request.hostname strips the port, so any instance not on 80/443 sent GitHub a redirect_uri without it (http://localhost/api/auth/github/callback for local dev on :3001) and the OAuth round-trip failed with a redirect_uri mismatch. Found standing up the devbox test instance on :3100. request.host keeps the port; the X-Forwarded-Host/X-Forwarded-Proto path used behind the gateway is unchanged. The new test covers both the direct and the proxied case.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TGqwPjt3v4eMfiHpPmCKnR

`request.hostname` strips the port, so an instance on anything but 80/443
sent GitHub a redirect_uri of `http://localhost/api/auth/github/callback`
and the round-trip failed with a redirect_uri mismatch — local dev on
:3001 and the devbox test instance on :3100 both hit it. `request.host`
keeps the port; the X-Forwarded-Host path behind the gateway is unchanged.
Test covers both.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGqwPjt3v4eMfiHpPmCKnR
@themightychris
themightychris merged commit 728898a into develop Oct 14, 2026
1 check passed
@themightychris
themightychris deleted the fix/oauth-callback-port branch October 14, 2026 17:16
@themightychris themightychris mentioned this pull request Oct 14, 2026
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