2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
# 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?
|
2021-06-08 01:23:25 +05:30
|
|
|
return false if user.password_based_login_forbidden?
|
2018-03-27 19:54:05 +05:30
|
|
|
|
2018-04-04 21:44:52 +05:30
|
|
|
return user if user&.valid_password?(password)
|
2018-03-27 19:54:05 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|