Class: Gitlab::Auth

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/auth.rb

Instance Method Summary collapse

Instance Method Details

#find(login, password) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/gitlab/auth.rb', line 3

def find(, password)
  user = User.()

  # If no user is found, or it's an LDAP server, try LDAP.
  #   LDAP users are only authenticated via LDAP
  if user.nil? || user.ldap_user?
    # Second chance - try LDAP authentication
    return nil unless Gitlab::LDAP::Config.enabled?

    Gitlab::LDAP::Authentication.(, password)
  else
    user if user.valid_password?(password)
  end
end