Skip to content

fix(sso): start sign-in on the configured site address - #6

Merged
qiansc merged 2 commits into
mainfrom
fix/login-on-site-address
Oct 27, 2026
Merged

qiansc merged 2 commits into
mainfrom
fix/login-on-site-address

Conversation

@qiansc

@qiansc qiansc commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • GitHub sign-in failed with INVALID_LOGIN_STATE when it was started on context4ai-sourcegraph.fly.dev (or an alias such as www.context4ai.org): the login binding cookie belongs to that host, but GitHub always returns to https://context4ai.org.
  • A login started on another address now first goes to /sourcegraph/login on the configured origin. Requests through the site proxy carry the original host in X-Forwarded-Host and start at the provider as before. Redirects only target the configured origin.

Test plan

  • New TestLoginStartsOnTheSiteAddress (Fly hostname and alias redirect without setting a cookie; proxied and direct site requests start the provider login)
  • go test ./..., go vet, public audit

🤖 Generated with Claude Code

qiansc and others added 2 commits October 27, 2026 07:53
A login started on the Fly hostname or an alias set the login binding
cookie on that host, while the provider returned to the site address, so
the callback failed with INVALID_LOGIN_STATE. Send such logins to the
sign-in screen on the configured origin first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qiansc
qiansc merged commit 86fb4d2 into main Oct 27, 2026
3 checks passed
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