Commit 7ea579bb by Garrett Bjerkhoel

Add team_ids configuration option

parent 8a986ec3
...@@ -140,6 +140,7 @@ enabled = false ...@@ -140,6 +140,7 @@ enabled = false
client_id = some_id client_id = some_id
client_secret = some_secret client_secret = some_secret
scopes = user:email scopes = user:email
team_ids =
auth_url = https://github.com/login/oauth/authorize auth_url = https://github.com/login/oauth/authorize
token_url = https://github.com/login/oauth/access_token token_url = https://github.com/login/oauth/access_token
api_url = https://api.github.com/user api_url = https://api.github.com/user
......
...@@ -75,7 +75,8 @@ func NewOAuthService() { ...@@ -75,7 +75,8 @@ func NewOAuthService() {
// GitHub. // GitHub.
if name == "github" { if name == "github" {
setting.OAuthService.GitHub = true setting.OAuthService.GitHub = true
SocialMap["github"] = &SocialGithub{Config: &config, allowedDomains: info.AllowedDomains, ApiUrl: info.ApiUrl, allowSignup: info.AllowSignup} teamIds := sec.Key("team_ids").Ints(",")
SocialMap["github"] = &SocialGithub{Config: &config, allowedDomains: info.AllowedDomains, ApiUrl: info.ApiUrl, allowSignup: info.AllowSignup, teamIds: teamIds}
} }
// Google. // Google.
...@@ -105,6 +106,7 @@ type SocialGithub struct { ...@@ -105,6 +106,7 @@ type SocialGithub struct {
allowedDomains []string allowedDomains []string
ApiUrl string ApiUrl string
allowSignup bool allowSignup bool
teamIds []int
} }
func (s *SocialGithub) Type() int { func (s *SocialGithub) Type() int {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment