diff --git a/lib/plugins/grack/auth.rb b/lib/plugins/grack/auth.rb index cafdc4cbd..d53847412 100644 --- a/lib/plugins/grack/auth.rb +++ b/lib/plugins/grack/auth.rb @@ -11,9 +11,9 @@ module Grack return render_not_found if project.blank? return ::Rack::Auth::Basic.new(@app) do |u, p| - user = User.auth_by_token_or_login_pass(u, p) && - ability = ::Ability.new(user) && ability.can?(action, project) && - ENV['GL_ID'] = "user-#{user.id}" && + user = User.auth_by_token_or_login_pass(u, p) and + ability = ::Ability.new(user) and ability.can?(action, project) and + ENV['GL_ID'] = "user-#{user.id}" and ENV['GL_REPO_PATH'] = project.path end.call(env) unless project.public? && read? # need auth end