소스 검색

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