diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-02-18 17:01:07 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-02-18 17:01:07 -0500 |
commit | 06376be56a84b43976b63aad91638fb2c00fec1a (patch) | |
tree | 049b4900ff1700a257a0da502f3c201c5e871bd1 /lib/gitlab/o_auth | |
parent | ea4d2741a2b574407b0bd387ccd6a8202c014fc5 (diff) | |
download | gitlab-ce-06376be56a84b43976b63aad91638fb2c00fec1a.tar.gz |
Decouple SAML authentication from the default Omniauth logic
Diffstat (limited to 'lib/gitlab/o_auth')
-rw-r--r-- | lib/gitlab/o_auth/user.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb index d87a72f7ba3..675ded92a89 100644 --- a/lib/gitlab/o_auth/user.rb +++ b/lib/gitlab/o_auth/user.rb @@ -26,7 +26,7 @@ module Gitlab gl_user.try(:valid?) end - def save + def save(provider = 'OAuth') unauthorized_to_create unless gl_user if needs_blocking? @@ -36,10 +36,10 @@ module Gitlab gl_user.save! end - log.info "(OAuth) saving user #{auth_hash.email} from login with extern_uid => #{auth_hash.uid}" + log.info "(#{provider}) saving user #{auth_hash.email} from login with extern_uid => #{auth_hash.uid}" gl_user rescue ActiveRecord::RecordInvalid => e - log.info "(OAuth) Error saving user: #{gl_user.errors.full_messages}" + log.info "(#{provider}) Error saving user: #{gl_user.errors.full_messages}" return self, e.record.errors end @@ -105,7 +105,8 @@ module Gitlab end def signup_enabled? - Gitlab.config.omniauth.allow_single_sign_on + providers = Gitlab.config.omniauth.allow_single_sign_on + providers.include?(auth_hash.provider) end def block_after_signup? |