Make Generic OAuth Configs ENV VARS-friendly

Use underscores instead of dashes.
This commit is contained in:
Kevin Fitzpatrick
2016-05-18 13:37:04 -07:00
parent b4646b6c3a
commit f2baa5b210
2 changed files with 4 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ func NewOAuthService() {
setting.OAuthService = &setting.OAuther{} setting.OAuthService = &setting.OAuther{}
setting.OAuthService.OAuthInfos = make(map[string]*setting.OAuthInfo) setting.OAuthService.OAuthInfos = make(map[string]*setting.OAuthInfo)
allOauthes := []string{"github", "google", "generic-oauth"} allOauthes := []string{"github", "google", "generic_oauth"}
for _, name := range allOauthes { for _, name := range allOauthes {
sec := setting.Cfg.Section("auth." + name) sec := setting.Cfg.Section("auth." + name)
@@ -100,12 +100,12 @@ func NewOAuthService() {
} }
// Generic - Uses the same scheme as Github. // Generic - Uses the same scheme as Github.
if name == "generic-oauth" { if name == "generic_oauth" {
setting.OAuthService.Generic = true setting.OAuthService.Generic = true
setting.OAuthService.OAuthProviderName = sec.Key("oauth_provider_name").String() setting.OAuthService.OAuthProviderName = sec.Key("oauth_provider_name").String()
teamIds := sec.Key("team_ids").Ints(",") teamIds := sec.Key("team_ids").Ints(",")
allowedOrganizations := sec.Key("allowed_organizations").Strings(" ") allowedOrganizations := sec.Key("allowed_organizations").Strings(" ")
SocialMap["generic-oauth"] = &SocialGithub{ SocialMap["generic_oauth"] = &SocialGithub{
Config: &config, Config: &config,
allowedDomains: info.AllowedDomains, allowedDomains: info.AllowedDomains,
apiUrl: info.ApiUrl, apiUrl: info.ApiUrl,

View File

@@ -59,7 +59,7 @@
<i class="fa fa-github"></i> <i class="fa fa-github"></i>
with Github with Github
</a> </a>
<a class="btn btn-large btn-generic-oauth" href="login/generic-oauth" target="_self" ng-if="genericOAuthEnabled"> <a class="btn btn-large btn-generic-oauth" href="login/generic_oauth" target="_self" ng-if="genericOAuthEnabled">
<i class="fa fa-gear"></i> <i class="fa fa-gear"></i>
with {{oauthProviderName || "OAuth 2"}} with {{oauthProviderName || "OAuth 2"}}
</a> </a>