Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Skip CSRF on repo-auth API

Oliver Günthera5fa8a24c3ad
diff --git a/app/controllers/sys_controller.rb b/app/controllers/sys_controller.rb
index 95e9132540a..a93aa6a1e60 100644
--- a/app/controllers/sys_controller.rb
+++ b/app/controllers/sys_controller.rb
@@ -34,6 +34,9 @@ class SysController < ActionController::Base
before_action :check_enabled
before_action :require_basic_auth, only: [:repo_auth]
+ # disable CSRF protection since the Sys API does not use sessions
+ skip_before_action :verify_authenticity_token
+
def repo_auth
project = Project.find_by(identifier: params[:repository])
if project && authorized?(project, @authenticated_user)