Add team_ids configuration option

This commit is contained in:
Garrett Bjerkhoel 2015-04-28 20:19:48 -07:00
parent 8a986ec340
commit 7ea579bb71
2 changed files with 4 additions and 1 deletions

View File

@ -140,6 +140,7 @@ enabled = false
client_id = some_id
client_secret = some_secret
scopes = user:email
team_ids =
auth_url = https://github.com/login/oauth/authorize
token_url = https://github.com/login/oauth/access_token
api_url = https://api.github.com/user

View File

@ -75,7 +75,8 @@ func NewOAuthService() {
// GitHub.
if name == "github" {
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.
@ -105,6 +106,7 @@ type SocialGithub struct {
allowedDomains []string
ApiUrl string
allowSignup bool
teamIds []int
}
func (s *SocialGithub) Type() int {