summaryrefslogtreecommitdiffstats
path: root/models/oauth2.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/oauth2.go')
-rw-r--r--models/oauth2.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/oauth2.go b/models/oauth2.go
index bf4446229a..c82c1cbadb 100644
--- a/models/oauth2.go
+++ b/models/oauth2.go
@@ -44,6 +44,13 @@ var OAuth2Providers = map[string]OAuth2Provider{
"openidConnect": {Name: "openidConnect", DisplayName: "OpenID Connect", Image: "/img/auth/openid_connect.png"},
"twitter": {Name: "twitter", DisplayName: "Twitter", Image: "/img/auth/twitter.png"},
"discord": {Name: "discord", DisplayName: "Discord", Image: "/img/auth/discord.png"},
+ "gitea": {Name: "gitea", DisplayName: "Gitea", Image: "/img/auth/gitea.png",
+ CustomURLMapping: &oauth2.CustomURLMapping{
+ TokenURL: oauth2.GetDefaultTokenURL("gitea"),
+ AuthURL: oauth2.GetDefaultAuthURL("gitea"),
+ ProfileURL: oauth2.GetDefaultProfileURL("gitea"),
+ },
+ },
}
// OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls
@@ -52,6 +59,7 @@ var OAuth2Providers = map[string]OAuth2Provider{
var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{
"github": OAuth2Providers["github"].CustomURLMapping,
"gitlab": OAuth2Providers["gitlab"].CustomURLMapping,
+ "gitea": OAuth2Providers["gitea"].CustomURLMapping,
}
// GetActiveOAuth2ProviderLoginSources returns all actived LoginOAuth2 sources