Fix lint error
This commit is contained in:
parent
d1fea99deb
commit
970582079a
1 changed files with 5 additions and 2 deletions
|
@ -132,13 +132,16 @@ module Gitlab
|
|||
|
||||
def current_user_from_basic_authentication?(request, project)
|
||||
return unless has_basic_credentials?(request)
|
||||
|
||||
login, password = user_name_and_password(request)
|
||||
auth_result = Gitlab::Auth.find_for_git_client(login, password, project: project, ip: request.ip)
|
||||
return unless auth_result.success?
|
||||
|
||||
return unless auth_result.actor&.can?(:access_api)
|
||||
|
||||
if auth_result.type == :personal_access_token
|
||||
apiScopeAbilities = Gitlab::Auth.abilities_for_scopes([:api])
|
||||
return unless auth_result.authentication_abilities.sort == apiScopeAbilities.sort
|
||||
api_sceope_abilities = Gitlab::Auth.abilities_for_scopes([:api])
|
||||
return unless auth_result.authentication_abilities.sort == api_sceope_abilities.sort
|
||||
end
|
||||
|
||||
auth_result.actor
|
||||
|
|
Loading…
Reference in a new issue