2013-05-24 12:43:47 -04:00
|
|
|
module OauthHelper
|
|
|
|
def ldap_enabled?
|
|
|
|
Devise.omniauth_providers.include?(:ldap)
|
|
|
|
end
|
|
|
|
|
|
|
|
def default_providers
|
|
|
|
[:twitter, :github, :google_oauth2, :ldap]
|
|
|
|
end
|
|
|
|
|
|
|
|
def enabled_oauth_providers
|
|
|
|
Devise.omniauth_providers
|
|
|
|
end
|
2013-05-28 11:00:44 -04:00
|
|
|
|
|
|
|
def enabled_social_providers
|
|
|
|
enabled_oauth_providers.select do |name|
|
|
|
|
[:twitter, :github, :google_oauth2].include?(name.to_sym)
|
|
|
|
end
|
|
|
|
end
|
2013-05-24 12:43:47 -04:00
|
|
|
end
|