diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-09-12 18:11:59 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-12 18:11:59 -0400 |
commit | 0d77209ea0f13184a8140efeaafa52bc916ec71f (patch) | |
tree | ed0bb189f402a2603edfdaac6f95b5c6c1e1a606 /lib/gitlab | |
parent | 3643df1f7cbcc3734055b0d710fd21dd4426ca3b (diff) | |
download | gitlab-ce-0d77209ea0f13184a8140efeaafa52bc916ec71f.tar.gz |
Be more resilient in the case of missing omniauth settings
Should no longer freak out when omniauth settings aren't present in
gitlab.yml. People who aren't using it shouldn't even have to put a
'false' entry in their config for it (and probably wouldn't, after an
upgrade).
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/auth.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index ef058ff5ed1..90bd5d74081 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -17,7 +17,7 @@ module Gitlab end end - def create_from_omniauth auth, ldap = false + def create_from_omniauth(auth, ldap = false) provider = auth.provider uid = auth.info.uid || auth.uid name = auth.info.name.force_encoding("utf-8") @@ -39,7 +39,7 @@ module Gitlab password_confirmation: password, projects_limit: Gitlab.config.default_projects_limit, ) - if Gitlab.config.omniauth.block_auto_created_users && !ldap + if Gitlab.config.omniauth['block_auto_created_users'] && !ldap @user.blocked = true end @user.save! @@ -52,7 +52,7 @@ module Gitlab if @user = User.find_by_provider_and_extern_uid(provider, uid) @user else - if Gitlab.config.omniauth.allow_single_sign_on + if Gitlab.config.omniauth['allow_single_sign_on'] @user = create_from_omniauth(auth) @user end |