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

avoid login check on ical controller

ulfertsf4623f525041
diff --git a/modules/calendar/app/controllers/calendar/ical_controller.rb b/modules/calendar/app/controllers/calendar/ical_controller.rb
index 745883760c2..46dd6f33f0d 100644
--- a/modules/calendar/app/controllers/calendar/ical_controller.rb
+++ b/modules/calendar/app/controllers/calendar/ical_controller.rb
@@ -28,6 +28,9 @@
module ::Calendar
class ICalController < ApplicationController
+ # Authentication and authorization is handled within the service.
+ skip_before_action :check_if_login_required
+
def show
begin
call = ::Calendar::ICalResponseService.new.call(
@@ -41,7 +44,6 @@ module ::Calendar
if call.present? && call.success?
send_data call.result, filename: "openproject_calendar_#{DateTime.now.to_i}.ics"
- # render plain: call.result # TODO: remove this, it's just handy for development debugging
else
render_404
end
diff --git a/modules/calendar/spec/controllers/ical_controller_spec.rb b/modules/calendar/spec/controllers/ical_controller_spec.rb
index b1a4dfb504f..3ac266fed8d 100644
--- a/modules/calendar/spec/controllers/ical_controller_spec.rb
+++ b/modules/calendar/spec/controllers/ical_controller_spec.rb
@@ -28,7 +28,7 @@
require 'spec_helper'
-RSpec.describe Calendar::ICalController do
+RSpec.describe Calendar::ICalController, with_settings: { login_required: true } do
let(:project) { create(:project) }
let(:user) do
create(:user,