summaryrefslogtreecommitdiff
path: root/app/controllers/profiles
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-06-17 19:27:51 +0000
committerRobert Speicher <robert@gitlab.com>2016-06-17 19:27:51 +0000
commitd9d149244a050f32dd00a9a1898eb5c309eb50eb (patch)
tree5dee734af88c7884dd89fccb3759c26a0d1ae5a0 /app/controllers/profiles
parent1db4fd3ae7cd3a4fa2f356a4c252820e26783a27 (diff)
parent2786edc931f1853883e5bbd9d2b83a824288ae5c (diff)
downloadgitlab-ce-d9d149244a050f32dd00a9a1898eb5c309eb50eb.tar.gz
Merge branch 'disable-saml-account-unlink' into 'master'
Disable the unlink feature for SAML connected accounts (social login). This disables the ability to manually unlink your SAML account, if you have one connected. In certain scenarios, the only allowed login mechanism can be SAML, and if you unlink your account you will be locked out of the system (configuration dependent). Fixes #18613 See merge request !4662
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r--app/controllers/profiles/accounts_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/profiles/accounts_controller.rb b/app/controllers/profiles/accounts_controller.rb
index 175afbf8425..69959fe3687 100644
--- a/app/controllers/profiles/accounts_controller.rb
+++ b/app/controllers/profiles/accounts_controller.rb
@@ -5,7 +5,7 @@ class Profiles::AccountsController < Profiles::ApplicationController
def unlink
provider = params[:provider]
- current_user.identities.find_by(provider: provider).destroy
+ current_user.identities.find_by(provider: provider).destroy unless provider.to_s == 'saml'
redirect_to profile_account_path
end
end