Skip to content

Commit 3faac62

Browse files
Copilotatharva1051
andcommitted
fix: only set AuthorizationServer when gh-host is explicitly configured
When gh-host is not set (github.com users), the AuthorizationServer field was being set to just "login/oauth" (empty host + path), breaking OAuth metadata. Now it only overrides the default when gh-host is provided (GHES users), allowing github.com users to get the correct default of "https://github.com/login/oauth". Co-authored-by: atharva1051 <53966412+atharva1051@users.noreply.github.com>
1 parent ee63c51 commit 3faac62

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pkg/http/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ func RunHTTPServer(cfg ServerConfig) error {
126126
oauthCfg := &oauth.Config{
127127
BaseURL: cfg.BaseURL,
128128
ResourcePath: cfg.ResourcePath,
129-
AuthorizationServer: cfg.Host + "login/oauth",
129+
}
130+
if cfg.Host != "" {
131+
oauthCfg.AuthorizationServer = cfg.Host + "login/oauth"
130132
}
131133

132134
serverOptions := []HandlerOption{}

0 commit comments

Comments
 (0)