From 7ea579bb71cf1d505c815d5907b4d8910772a488 Mon Sep 17 00:00:00 2001 From: Garrett Bjerkhoel Date: Tue, 28 Apr 2015 20:19:48 -0700 Subject: [PATCH] Add team_ids configuration option --- conf/defaults.ini | 1 + pkg/social/social.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index 6bb3fb80857..7345f18520e 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -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 diff --git a/pkg/social/social.go b/pkg/social/social.go index 47c7ea5dc38..c19784e34e1 100644 --- a/pkg/social/social.go +++ b/pkg/social/social.go @@ -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 {