Use proper labels for OAuth providers
This commit is contained in:
parent
4773d98e83
commit
98dcad2762
|
@ -1,6 +1,12 @@
|
||||||
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
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue