@@ -11,19 +11,18 @@ import (
11
11
"fmt"
12
12
"net/smtp"
13
13
"net/textproto"
14
+ "sort"
14
15
"strings"
15
16
"time"
16
17
18
+ "code.gitea.io/gitea/modules/auth/ldap"
19
+ "code.gitea.io/gitea/modules/auth/oauth2"
20
+ "code.gitea.io/gitea/modules/auth/pam"
21
+ "code.gitea.io/gitea/modules/log"
17
22
"github.com/Unknwon/com"
18
23
"github.com/go-macaron/binding"
19
24
"github.com/go-xorm/core"
20
25
"github.com/go-xorm/xorm"
21
-
22
- "code.gitea.io/gitea/modules/auth/ldap"
23
- "code.gitea.io/gitea/modules/auth/pam"
24
- "code.gitea.io/gitea/modules/log"
25
- "code.gitea.io/gitea/modules/auth/oauth2"
26
- "sort"
27
26
)
28
27
29
28
// LoginType represents an login type.
@@ -763,11 +762,12 @@ func InitOAuth2() {
763
762
oauth2 .RegisterProvider (source .Name , oAuth2Config .Provider , oAuth2Config .ClientID , oAuth2Config .ClientSecret , oAuth2Config .OpenIDConnectAutoDiscoveryURL )
764
763
}
765
764
}
765
+
766
766
// wrapOpenIDConnectInitializeError is used to wrap the error but this cannot be done in modules/auth/oauth2
767
767
// inside oauth2: import cycle not allowed models -> modules/auth/oauth2 -> models
768
768
func wrapOpenIDConnectInitializeError (err error , providerName string , oAuth2Config * OAuth2Config ) error {
769
769
if err != nil && "openidConnect" == oAuth2Config .Provider {
770
- err = ErrOpenIDConnectInitialize {ProviderName :providerName ,OpenIDConnectAutoDiscoveryURL :oAuth2Config .OpenIDConnectAutoDiscoveryURL ,Cause :err }
770
+ err = ErrOpenIDConnectInitialize {ProviderName : providerName , OpenIDConnectAutoDiscoveryURL : oAuth2Config .OpenIDConnectAutoDiscoveryURL , Cause : err }
771
771
}
772
772
return err
773
- }
773
+ }
0 commit comments