ソースを参照

feature: OAuth2 Redirect URL

jamesread 1 年間 前
コミット
fb7e650267
2 ファイル変更2 行追加1 行削除
  1. 1 0
      internal/config/config.go
  2. 1 1
      internal/httpservers/oauth2.go

+ 1 - 0
internal/config/config.go

@@ -117,6 +117,7 @@ type Config struct {
 	AuthHttpHeaderUserGroup         string
 	AuthLoginUrl                    string
 	AuthAllowGuest                  bool
+	AuthOAuth2RedirectURL           string
 	AuthOAuth2Providers             map[string]*OAuth2Provider
 	DefaultPermissions              PermissionsList
 	AccessControlLists              []*AccessControlList

+ 1 - 1
internal/httpservers/oauth2.go

@@ -69,7 +69,7 @@ func getOAuth2Config(cfg *config.Config, providerName string) (*oauth2.Config, e
 				AuthURL:  providerConfig.AuthUrl,
 				TokenURL: providerConfig.TokenUrl,
 			},
-			RedirectURL: "http://localhost:1337/oauth/callback",
+			RedirectURL: cfg.AuthOAuth2RedirectURL,
 		}
 
 		registeredProviders[providerName] = config