Welcome to mirror list, hosted at ThFree Co, Russian Federation.

authentication.rb « database « auth « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bf35a9abe41dd198335b695871f7cb96db3d2ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

# These calls help to authenticate to OAuth provider by providing username and password
#

module Gitlab
  module Auth
    module Database
      class Authentication < Gitlab::Auth::OAuth::Authentication
        def login(login, password)
          return false unless Gitlab::CurrentSettings.password_authentication_enabled_for_git?
          return false if user.password_based_login_forbidden?

          return user if user&.valid_password?(password)
        end
      end
    end
  end
end