hide oauth login when not configured

This commit is contained in:
Zachary Chai
2016-11-23 14:20:28 -05:00
parent d11c998fa9
commit 423b649480
3 changed files with 31 additions and 7 deletions

View File

@ -14,4 +14,16 @@ module ApplicationHelper
end
translations[:client]
end
def omniauth_providers_configured(provider = nil)
if provider
Rails.configuration.send("omniauth_#{provider}")
else
providers = []
Rails.configuration.providers.each do |provider|
providers.push(provider) if Rails.configuration.send("omniauth_#{provider}")
end
providers
end
end
end