Skip to content

Commit 7d36b8f

Browse files
panxunyingpanxunying
authored andcommitted
fix network error
Signed-off-by: panxunying <[email protected]>
1 parent d901724 commit 7d36b8f

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

connector/gitea/gitea.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ func (c *giteaConnector) oauth2Config(_ connector.Scopes) *oauth2.Config {
8383
}
8484

8585
func (c *giteaConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) {
86-
if c.redirectURI != callbackURL {
87-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", c.redirectURI, callbackURL)
88-
}
86+
//if c.redirectURI != callbackURL {
87+
// return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", c.redirectURI, callbackURL)
88+
//}
8989
return c.oauth2Config(scopes).AuthCodeURL(state), nil
9090
}
9191

connector/github/github.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ func (c *githubConnector) oauth2Config(scopes connector.Scopes) *oauth2.Config {
188188
}
189189

190190
func (c *githubConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) {
191-
if c.redirectURI != callbackURL {
192-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
193-
}
191+
//if c.redirectURI != callbackURL {
192+
// return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
193+
//}
194194

195195
return c.oauth2Config(scopes).AuthCodeURL(state), nil
196196
}

connector/gitlab/gitlab.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ func (c *gitlabConnector) oauth2Config(scopes connector.Scopes) *oauth2.Config {
9999
}
100100

101101
func (c *gitlabConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) {
102-
if c.redirectURI != callbackURL {
103-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", c.redirectURI, callbackURL)
104-
}
102+
//if c.redirectURI != callbackURL {
103+
// return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", c.redirectURI, callbackURL)
104+
//}
105105
return c.oauth2Config(scopes).AuthCodeURL(state), nil
106106
}
107107

connector/google/google.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ func (c *googleConnector) Close() error {
121121
}
122122

123123
func (c *googleConnector) LoginURL(s connector.Scopes, callbackURL, state string) (string, error) {
124-
if c.redirectURI != callbackURL {
125-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
126-
}
124+
//if c.redirectURI != callbackURL {
125+
// return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
126+
//}
127127

128128
var opts []oauth2.AuthCodeOption
129129
if len(c.hostedDomains) > 0 {

connector/microsoft/microsoft.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ func (c *microsoftConnector) oauth2Config(scopes connector.Scopes) *oauth2.Confi
152152
}
153153

154154
func (c *microsoftConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) {
155-
if c.redirectURI != callbackURL {
156-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
157-
}
155+
//if c.redirectURI != callbackURL {
156+
// return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
157+
//}
158158

159159
var options []oauth2.AuthCodeOption
160160
if c.promptType != "" {

connector/oauth/oauth.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ func newHTTPClient(rootCAs []string, insecureSkipVerify bool) (*http.Client, err
148148
}
149149

150150
func (c *oauthConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) {
151-
if c.redirectURI != callbackURL {
152-
c.logger.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
153-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
154-
}
151+
//if c.redirectURI != callbackURL {
152+
// c.logger.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
153+
// return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
154+
//}
155155

156156
oauth2Config := &oauth2.Config{
157157
ClientID: c.clientID,

connector/oidc/oidc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ func (c *oidcConnector) Close() error {
189189
}
190190

191191
func (c *oidcConnector) LoginURL(s connector.Scopes, callbackURL, state string) (string, error) {
192-
if c.redirectURI != callbackURL {
193-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
194-
}
192+
//if c.redirectURI != callbackURL {
193+
// return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
194+
//}
195195

196196
var opts []oauth2.AuthCodeOption
197197
if len(c.hostedDomains) > 0 {

connector/openshift/openshift.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ func (c *openshiftConnector) Close() error {
118118

119119
// LoginURL returns the URL to redirect the user to login with.
120120
func (c *openshiftConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) {
121-
if c.redirectURI != callbackURL {
122-
return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
123-
}
121+
//if c.redirectURI != callbackURL {
122+
// return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
123+
//}
124124
return c.oauth2Config.AuthCodeURL(state), nil
125125
}
126126

0 commit comments

Comments
 (0)