Commit 70f8e1a7 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Remove users' ability to remove their auth connections

parent fd71b374
......@@ -8,20 +8,6 @@ def show
# rubocop: disable CodeReuse/ActiveRecord
def unlink
provider = params[:provider]
identity = current_user.identities.find_by(provider: provider)
return render_404 unless identity
if unlink_allowed?(provider)
flash[:alert] = "You are not allowed to unlink your primary login account"
redirect_to profile_account_path
# rubocop: enable CodeReuse/ActiveRecord
......@@ -21,33 +21,6 @@
= link_to _('Enable two-factor authentication'), profile_two_factor_auth_path, class: 'btn btn-success'
- if display_providers_on_profile?
= s_('Profiles|Social sign-in')
= s_('Profiles|Activate signin with one of the following services')
= s_('Profiles|Connected Accounts')
%p= s_('Profiles|Click on icon to activate signin with one of the following services')
- button_based_providers.each do |provider|
= provider_image_tag(provider)
- if auth_active?(provider)
- if unlink_allowed?(provider)
= link_to unlink_profile_account_path(provider: provider), method: :delete, class: 'provider-btn' do
= s_('Profiles|Disconnect')
- else
= s_('Profiles|Active')
- else
= link_to omniauth_authorize_path(:user, provider), method: :post, class: 'provider-btn not-active' do
= s_('Profiles|Connect')
= render_if_exists 'profiles/accounts/group_saml_unlink_buttons', group_saml_identities: local_assigns[:group_saml_identities]
- if current_user.can_change_username?
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment