diff options
author | techknowlogick <hello@techknowlogick.com> | 2019-01-13 14:06:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-13 14:06:22 -0500 |
commit | 5c44f751a30517914ad232607a1202111cf4f0fa (patch) | |
tree | 5c2efcfa35e80d092bfd246f1c3a966792f9bb5f /modules/auth | |
parent | beab2df1227f9b7e556aa5716d94feb3a3e2088e (diff) | |
download | gitea-5c44f751a30517914ad232607a1202111cf4f0fa.tar.gz gitea-5c44f751a30517914ad232607a1202111cf4f0fa.zip |
Discord Oauth2 support (#4476)
* add discord auth
* add vendor for discord
* fix syntax error
* make fmt
* update version of goth in use
* update markbates/goth
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/oauth2/oauth2.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/auth/oauth2/oauth2.go b/modules/auth/oauth2/oauth2.go index de125c6195..5684f44a89 100644 --- a/modules/auth/oauth2/oauth2.go +++ b/modules/auth/oauth2/oauth2.go @@ -16,6 +16,7 @@ import ( "github.com/markbates/goth" "github.com/markbates/goth/gothic" "github.com/markbates/goth/providers/bitbucket" + "github.com/markbates/goth/providers/discord" "github.com/markbates/goth/providers/dropbox" "github.com/markbates/goth/providers/facebook" "github.com/markbates/goth/providers/github" @@ -172,6 +173,8 @@ func createProvider(providerName, providerType, clientID, clientSecret, openIDCo } case "twitter": provider = twitter.NewAuthenticate(clientID, clientSecret, callbackURL) + case "discord": + provider = discord.New(clientID, clientSecret, callbackURL, discord.ScopeIdentify, discord.ScopeEmail) } // always set the name if provider is created so we can support multiple setups of 1 provider |