diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2017-11-17 14:24:25 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-11-17 14:24:25 +0000 |
commit | c7cf68bd6ff744e044944acad586e06badc481d4 (patch) | |
tree | 6cf6af687696012525b6cb05b336bec13f049a10 /lib | |
parent | 76b2a7caa5219662a29f0eb16f0507aac1976f33 (diff) | |
download | gitlab-ce-c7cf68bd6ff744e044944acad586e06badc481d4.tar.gz |
Changing OAuth lookup to be case insensitive
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ldap/user.rb | 5 | ||||
-rw-r--r-- | lib/gitlab/o_auth/user.rb | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb index 4d5c67ed892..3945df27eed 100644 --- a/lib/gitlab/ldap/user.rb +++ b/lib/gitlab/ldap/user.rb @@ -9,11 +9,8 @@ module Gitlab class User < Gitlab::OAuth::User class << self def find_by_uid_and_provider(uid, provider) - uid = Gitlab::LDAP::Person.normalize_dn(uid) + identity = ::Identity.with_extern_uid(provider, uid).take - identity = ::Identity - .where(provider: provider) - .where(extern_uid: uid).last identity && identity.user end end diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb index b4b3b00c84d..552133234a3 100644 --- a/lib/gitlab/o_auth/user.rb +++ b/lib/gitlab/o_auth/user.rb @@ -157,7 +157,7 @@ module Gitlab end def find_by_uid_and_provider - identity = Identity.find_by(provider: auth_hash.provider, extern_uid: auth_hash.uid) + identity = Identity.with_extern_uid(auth_hash.provider, auth_hash.uid).take identity && identity.user end |