|
@@ -6,15 +6,16 @@ package models
|
6
|
6
|
|
7
|
7
|
import (
|
8
|
8
|
"sort"
|
|
9
|
+
|
9
|
10
|
"code.gitea.io/gitea/modules/auth/oauth2"
|
10
|
11
|
)
|
11
|
12
|
|
12
|
13
|
// OAuth2Provider describes the display values of a single OAuth2 provider
|
13
|
14
|
type OAuth2Provider struct {
|
14
|
|
- Name string
|
15
|
|
- DisplayName string
|
16
|
|
- Image string
|
17
|
|
- CustomURLMapping *oauth2.CustomURLMapping
|
|
15
|
+ Name string
|
|
16
|
+ DisplayName string
|
|
17
|
+ Image string
|
|
18
|
+ CustomURLMapping *oauth2.CustomURLMapping
|
18
|
19
|
}
|
19
|
20
|
|
20
|
21
|
// OAuth2Providers contains the map of registered OAuth2 providers in Gitea (based on goth)
|
|
@@ -47,7 +48,7 @@ var OAuth2Providers = map[string]OAuth2Provider{
|
47
|
48
|
// OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls
|
48
|
49
|
// key is used to map the OAuth2Provider
|
49
|
50
|
// value is the mapping as defined for the OAuth2Provider
|
50
|
|
-var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping {
|
|
51
|
+var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{
|
51
|
52
|
"github": OAuth2Providers["github"].CustomURLMapping,
|
52
|
53
|
"gitlab": OAuth2Providers["gitlab"].CustomURLMapping,
|
53
|
54
|
}
|
|
@@ -119,4 +120,3 @@ func wrapOpenIDConnectInitializeError(err error, providerName string, oAuth2Conf
|
119
|
120
|
}
|
120
|
121
|
return err
|
121
|
122
|
}
|
122
|
|
-
|