Commit c5f9b269 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Remove users' ability to remove their auth connections

parent cfae53bc
......@@ -8,20 +8,6 @@ class Profiles::AccountsController < Profiles::ApplicationController
end
# rubocop: disable CodeReuse/ActiveRecord
def unlink
provider = params[:provider]
identity = current_user.identities.find_by(provider: provider)
return render_404 unless identity
if unlink_provider_allowed?(provider)
identity.destroy
else
flash[:alert] = "You are not allowed to unlink your primary login account"
end
redirect_to profile_account_path
end
# rubocop: enable CodeReuse/ActiveRecord
private
......
......@@ -21,16 +21,6 @@
= link_to _('Enable two-factor authentication'), profile_two_factor_auth_path, class: 'btn btn-success'
%hr
- if display_providers_on_profile?
.row.prepend-top-default
.col-lg-4.profile-settings-sidebar
%h4.prepend-top-0
= s_('Profiles|Social sign-in')
%p
= s_('Profiles|Activate signin with one of the following services')
.col-lg-8
= render 'providers', providers: button_based_providers, group_saml_identities: local_assigns[:group_saml_identities]
%hr
- if current_user.can_change_username?
.row.prepend-top-default
.col-lg-4.profile-settings-sidebar
......
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