docbrown/app/views/users/_additional_authentication.html.erb

20 lines
1 KiB
Text

<% unless @user.authenticated_with_all_providers? %>
<div class="crayons-card crayons-card--content-rows block">
<% authentication_enabled_providers.each do |provider| %>
<!--
INFO: [@forem/oss] We only support creating new accounts and then
signing in with them) using Apple Auth. Connecting Forem existing
accounts to Apple Auth isn't supported and is why we skip it here.
-->
<% next if provider.provider_name == :apple %>
<% unless @user.authenticated_through?(provider.provider_name) %>
<%= form_with url: provider.sign_in_path(state: "profile"), class: "flex w-100", local: true do |f| %>
<%= f.button type: :submit, class: "crayons-btn crayons-btn--icon-left crayons-btn--brand-#{provider.provider_name} m-1" do %>
<%= crayons_icon_tag(provider.provider_name, title: provider.official_name) %>
<%= t("views.settings.account.connect", provider: provider.official_name) %>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<% end %>