diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-03 19:58:26 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-03 19:59:07 +0300 |
commit | 98dcad2762930b0dc967ff8e67f9f795228d2342 (patch) | |
tree | 1e8d97e9628f423b1d225a06b72ca8c4b829f8c1 /lib/gitlab/o_auth | |
parent | 4773d98e835dd14bd73e7bde0d5bcf4754355976 (diff) |
Use proper labels for OAuth providers
Diffstat (limited to 'lib/gitlab/o_auth')
-rw-r--r-- | lib/gitlab/o_auth/provider.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/o_auth/provider.rb b/lib/gitlab/o_auth/provider.rb index 90c3fe8da33..9ad7a38d505 100644 --- a/lib/gitlab/o_auth/provider.rb +++ b/lib/gitlab/o_auth/provider.rb @@ -1,6 +1,12 @@ module Gitlab module OAuth class Provider + LABELS = { + "github" => "GitHub", + "gitlab" => "GitLab.com", + "google_oauth2" => "Google" + }.freeze + def self.providers Devise.omniauth_providers end @@ -23,8 +29,9 @@ module Gitlab end def self.label_for(name) + name = name.to_s config = config_for(name) - (config && config['label']) || name.to_s.titleize + (config && config['label']) || LABELS[name] || name.titleize end end end |