summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-03 17:58:26 +0100
committerDouwe Maan <douwe@gitlab.com>2015-11-03 17:59:07 +0100
commit98dcad2762930b0dc967ff8e67f9f795228d2342 (patch)
tree1e8d97e9628f423b1d225a06b72ca8c4b829f8c1 /lib
parent4773d98e835dd14bd73e7bde0d5bcf4754355976 (diff)
downloadgitlab-ce-98dcad2762930b0dc967ff8e67f9f795228d2342.tar.gz
Use proper labels for OAuth providers
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/o_auth/provider.rb9
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