summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-22 17:07:29 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-23 09:33:20 -0600
commit6f5cd03fcb63b379d218cf0b475f85f675dd9fb6 (patch)
treee42bc9cbe9b7bfa3fc3545bddd32de9eec584ac6
parent56de781a2cef437b6e1af748dc0c231af74e044d (diff)
downloadgitlab-ce-6f5cd03fcb63b379d218cf0b475f85f675dd9fb6.tar.gz
Fix OAuth/SAML user blocking behavior
-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