diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-05-02 13:19:39 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-05-02 13:19:39 +0200 |
commit | d1f5019511a1dc630e97f99bdb1f6b9fe6b02bba (patch) | |
tree | d55c9b5a96640d5a696d2484dde670289f6ed81f /lib | |
parent | b1ffc9f0fee16251899e5a2efbc78c4781ef4902 (diff) | |
download | gitlab-ce-d1f5019511a1dc630e97f99bdb1f6b9fe6b02bba.tar.gz |
Use correct auth finder
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/session.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/backend/grack_auth.rb | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/lib/api/session.rb b/lib/api/session.rb index e308ccc3004..1156aab8cc2 100644 --- a/lib/api/session.rb +++ b/lib/api/session.rb @@ -11,12 +11,7 @@ module API # Example Request: # POST /session post "/session" do - user, _ = Gitlab::Auth.find( - params[:email] || params[:login], - params[:password], - project: nil, - ip: request.ip - ) + user = Gitlab::Auth.find_by_master_or_ldap(params[:email] || params[:login], params[:password]) return unauthorized! unless user present user, with: Entities::UserLogin diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb index b263a27d4d3..3462c2dcfbc 100644 --- a/lib/gitlab/backend/grack_auth.rb +++ b/lib/gitlab/backend/grack_auth.rb @@ -95,7 +95,7 @@ module Grack end def authenticate_user(login, password) - user, _ = Gitlab::Auth.new.find_by_master_or_ldap(login, password) + user = Gitlab::Auth.new.find_by_master_or_ldap(login, password) unless user user = oauth_access_token_check(login, password) |