summaryrefslogtreecommitdiff
path: root/lib/gitlab/ldap/auth_hash.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ldap/auth_hash.rb')
-rw-r--r--lib/gitlab/ldap/auth_hash.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/gitlab/ldap/auth_hash.rb b/lib/gitlab/ldap/auth_hash.rb
index caca7bb3b57..dc8a8fd41dd 100644
--- a/lib/gitlab/ldap/auth_hash.rb
+++ b/lib/gitlab/ldap/auth_hash.rb
@@ -3,17 +3,10 @@
module Gitlab
module LDAP
class AuthHash < Gitlab::OAuth::AuthHash
- attr_accessor :config
-
- def initialize(auth_hash, config)
- super(auth_hash)
- @config = config
- end
-
private
def get_info(key)
- raw_key = config.attributes[key]
+ raw_key = ldap_config.attributes[key]
return super unless raw_key
value =
@@ -35,6 +28,10 @@ module Gitlab
def get_raw(key)
auth_hash.extra[:raw_info][key]
end
+
+ def ldap_config
+ @ldap_config ||= Gitlab::LDAP::Config.new(self.provider)
+ end
end
end
end