summaryrefslogtreecommitdiffstats
path: root/models/oauth2.go
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2019-09-12 22:15:36 -0400
committerGitHub <noreply@github.com>2019-09-12 22:15:36 -0400
commit2837563147d18dba263ed4c7a1b87571474220c4 (patch)
tree653d95c0538e1e32853ebbc52ee1487994159715 /models/oauth2.go
parentcff0787759304fcebf1c0e21709158e7d4f1967f (diff)
downloadgitea-2837563147d18dba263ed4c7a1b87571474220c4.tar.gz
gitea-2837563147d18dba263ed4c7a1b87571474220c4.zip
oauth2 with remote Gitea - Fix #8093 (#8149)
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