gitlab-org--gitlab-foss/app/helpers/oauth_helper.rb

26 lines
555 B
Ruby
Raw Normal View History

module OauthHelper
def ldap_enabled?
Gitlab.config.ldap.enabled
end
def default_providers
2015-02-17 10:59:50 -05:00
[:twitter, :github, :gitlab, :bitbucket, :google_oauth2, :ldap]
end
def enabled_oauth_providers
Devise.omniauth_providers
end
def enabled_social_providers
enabled_oauth_providers.select do |name|
2015-02-17 10:59:50 -05:00
[:twitter, :gitlab, :github, :bitbucket, :google_oauth2].include?(name.to_sym)
end
end
2014-12-04 05:55:37 -05:00
def additional_providers
enabled_oauth_providers.reject{|provider| provider.to_s.starts_with?('ldap')}
end
2015-02-17 16:52:32 -05:00
extend self
end