Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-23 02:07:29 +0300
committerDouwe Maan <douwe@selenight.nl>2017-02-23 18:33:20 +0300
commit6f5cd03fcb63b379d218cf0b475f85f675dd9fb6 (patch)
treee42bc9cbe9b7bfa3fc3545bddd32de9eec584ac6 /lib/gitlab/o_auth
parent56de781a2cef437b6e1af748dc0c231af74e044d (diff)
Fix OAuth/SAML user blocking behavior
Diffstat (limited to 'lib/gitlab/o_auth')
-rw-r--r--lib/gitlab/o_auth/user.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb
index 87af76cc122..95d2f559588 100644
--- a/lib/gitlab/o_auth/user.rb
+++ b/lib/gitlab/o_auth/user.rb
@@ -29,9 +29,11 @@ module Gitlab
def save(provider = 'OAuth')
unauthorized_to_create unless gl_user
+ block_after_save = needs_blocking?
+
gl_user.save!
- gl_user.block if needs_blocking?
+ gl_user.block if block_after_save
log.info "(#{provider}) saving user #{auth_hash.email} from login with extern_uid => #{auth_hash.uid}"
gl_user