<div id="social-signin-links">
  <% if (!spree_current_user || !spree_current_user.user_authentications) && Spree::AuthenticationMethod.active_authentication_methods? %>
    <h2><%= I18n.t('spree.sign_in_through_one_of_these_services') %></h2>
  <% end %>

  <% Spree::AuthenticationMethod.available_for(spree_current_user).each do |method| %>
    <%= link_to(content_tag(:i, '', class: "icon-spree-#{method.provider.dasherize}-circled"),
          spree.send("spree_user_#{method.provider}_omniauth_authorize_path"),
          title: I18n.t('spree.sign_in_with', provider: method.provider)) if method.active %>
  <% end %>
</div>

<div id="social-signin-links">
  <% if (!spree_current_user || !spree_current_user.user_authentications) && Spree::AuthenticationMethod.active_authentication_methods? %>
    <h2><%= I18n.t('spree.sign_in_through_one_of_these_services') %></h2>
  <% end %>

  <% Spree::AuthenticationMethod.available_for(spree_current_user).each do |method| %>
    <%= link_to(content_tag(:i, '', class: "icon-spree-#{method.provider.dasherize}-circled"),
          spree.send("spree_user_#{method.provider}_omniauth_authorize_path", r: rand),
          title: t('spree.sign_in_with', provider: method.provider)) if method.active %>
  <% end %>
</div>

Fix issue when using Safari to authenticate
Fix issue when using Safari to authenticate

https://github.com/omniauth/omniauth-oauth2/issues/58#issuecomment-347280092
