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
This commit is contained in:
parent
beab2df122
commit
5c44f751a3
10 changed files with 308 additions and 26 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue