docbrown/app/helpers/authentication_helper.rb
rhymes eddcb4953e
Display all authentication providers in mailer footer (#9961)
* Display all authentication providers in mailer footer

* Refactor into Authentication::Providers.enabled_for_user
2020-08-24 21:02:05 +02:00

21 lines
619 B
Ruby

module AuthenticationHelper
def authentication_provider(provider_name)
Authentication::Providers.get!(provider_name)
end
def authentication_available_providers
Authentication::Providers.available.map do |provider_name|
Authentication::Providers.const_get(provider_name.to_s.titleize)
end
end
def authentication_enabled_providers
Authentication::Providers.enabled.map do |provider_name|
Authentication::Providers.get!(provider_name)
end
end
def authentication_enabled_providers_for_user(user = current_user)
Authentication::Providers.enabled_for_user(user)
end
end