Commit d1f50195 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use correct auth finder

parent b1ffc9f0
......@@ -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
......
......@@ -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)
......
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