Commit 98dcad27 authored by Douwe Maan's avatar Douwe Maan

Use proper labels for OAuth providers

parent 4773d98e
module Gitlab module Gitlab
module OAuth module OAuth
class Provider class Provider
LABELS = {
"github" => "GitHub",
"gitlab" => "GitLab.com",
"google_oauth2" => "Google"
}.freeze
def self.providers def self.providers
Devise.omniauth_providers Devise.omniauth_providers
end end
...@@ -23,8 +29,9 @@ module Gitlab ...@@ -23,8 +29,9 @@ module Gitlab
end end
def self.label_for(name) def self.label_for(name)
name = name.to_s
config = config_for(name) config = config_for(name)
(config && config['label']) || name.to_s.titleize (config && config['label']) || LABELS[name] || name.titleize
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment