From 27062ea5c310f2f657e6807b440f92aa367b87d7 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 12 Aug 2025 17:59:47 +0200 Subject: [PATCH] Move sign_in_path into the controller it's used... --- app/controllers/admin/base_controller.rb | 10 +++++++++- app/helpers/application_helper.rb | 8 -------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb index 9b842b71..ed6adef3 100644 --- a/app/controllers/admin/base_controller.rb +++ b/app/controllers/admin/base_controller.rb @@ -16,7 +16,7 @@ module Admin end def verify_user_admin - if (current_user.nil?) + if current_user.nil? redirect_to sign_in_path return false end @@ -26,5 +26,13 @@ module Admin raise CanCan::AccessDenied.new('You are not authorized to access this page.') end end + + def sign_in_path + if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true' + User.ichain_login_url + else + new_user_session_path + end + end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0be070a2..b70dbac9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -115,14 +115,6 @@ module ApplicationHelper conference.event_types.map { |et| et.title.pluralize }.to_sentence end - def sign_in_path - if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) == 'true' - new_user_ichain_session_path - else - new_user_session_path - end - end - def rescheduling_hint(affected_event_count) if affected_event_count > 0 "You have #{affected_event_count} scheduled #{'event'.pluralize(affected_event_count)}. Changing the conference hours will unschedule those scheduled outside the conference hours."