diff --git a/app/helpers/authentication_helper.rb b/app/helpers/authentication_helper.rb index 7d244c7fc..b1980ab38 100644 --- a/app/helpers/authentication_helper.rb +++ b/app/helpers/authentication_helper.rb @@ -15,6 +15,10 @@ module AuthenticationHelper end end + def authentication_provider_enabled?(provider_name) + authentication_enabled_providers.include?(provider_name) + end + def authentication_enabled_providers_for_user(user = current_user) Authentication::Providers.enabled_for_user(user) end diff --git a/app/views/admin/configs/_apple_auth_provider_settings.html.erb b/app/views/admin/configs/_apple_auth_provider_settings.html.erb index bb20ce2da..36252b1ea 100644 --- a/app/views/admin/configs/_apple_auth_provider_settings.html.erb +++ b/app/views/admin/configs/_apple_auth_provider_settings.html.erb @@ -5,7 +5,7 @@ requires a custom partial -->
"> + class="crayons-notice crayons-notice--warning auth-warning <%= authentication_provider_enabled?(provider) ? "hidden" : "" %>"> Note: This authentication provider will not be enabled if the key or secret are missing. Please make sure that you enter your key and secret correctly.
@@ -49,7 +49,7 @@ requires a custom partial placeholder: Constants::SiteConfig::DETAILS[:apple_team_id][:placeholder] %>
- <% if authentication_enabled_providers.include?(provider) %> + <% if authentication_provider_enabled?(provider) %>
- <% if authentication_enabled_providers.include?(provider) %> + <% if authentication_provider_enabled?(provider) %>