Use proper labels for OAuth providers
This commit is contained in:
parent
4773d98e83
commit
98dcad2762
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue