diff options
author | Robert Speicher <robert@gitlab.com> | 2015-11-04 15:23:38 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-11-04 15:23:38 +0000 |
commit | 5df6b0b758821089c3685e3252b80c66ef6b1bc9 (patch) | |
tree | 9a166ad13ca283fd586e1cfaa05886b2f6effaac /lib | |
parent | 3f05c22f5612c26ff3707aa16eb0f3c8be18ec93 (diff) | |
parent | 05eb9e7884a1a1eb4144f84e7f586d26b011f4f1 (diff) | |
download | gitlab-ce-5df6b0b758821089c3685e3252b80c66ef6b1bc9.tar.gz |
Merge branch 'facebook-auth' into 'master'
Add Facebook authentication
See merge request !1740
Diffstat (limited to 'lib')
-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 |