Commit 5ad12d61 authored by Alain Takoudjou's avatar Alain Takoudjou

fixup! NXD lib:gitlab:auth Accept Basic auth from project runner_token

Project.with_builds_enabled.find_by(runners_token: TOKEN) is not working with project created since upgrade to gitlab v11.11.
parent 193b94c3
...@@ -243,7 +243,11 @@ module Gitlab ...@@ -243,7 +243,11 @@ module Gitlab
return unless password return unless password
# XXX-nxd: we also accept runners_token if enabled on projects # XXX-nxd: we also accept runners_token if enabled on projects
project = Project.with_builds_enabled.find_by(runners_token: password) project = Project.find_by_runners_token(password)
unless project
# compatibility with projects created since gitlab 8.17
project = Project.with_builds_enabled.find_by(runners_token: password)
end
if project if project
Gitlab::Auth::Result.new(nil, project, :ci, build_authentication_abilities) Gitlab::Auth::Result.new(nil, project, :ci, build_authentication_abilities)
else else
......
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