Commit d1f50195 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use correct auth finder

parent b1ffc9f0
...@@ -11,12 +11,7 @@ module API ...@@ -11,12 +11,7 @@ module API
# Example Request: # Example Request:
# POST /session # POST /session
post "/session" do post "/session" do
user, _ = Gitlab::Auth.find( user = Gitlab::Auth.find_by_master_or_ldap(params[:email] || params[:login], params[:password])
params[:email] || params[:login],
params[:password],
project: nil,
ip: request.ip
)
return unauthorized! unless user return unauthorized! unless user
present user, with: Entities::UserLogin present user, with: Entities::UserLogin
......
...@@ -95,7 +95,7 @@ module Grack ...@@ -95,7 +95,7 @@ module Grack
end end
def authenticate_user(login, password) 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 unless user
user = oauth_access_token_check(login, password) user = oauth_access_token_check(login, password)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment