Move sign_in_path into the controller it's used...

This commit is contained in:
Henne Vogelsang 2025-08-12 17:59:47 +02:00
parent 8e173ef713
commit 27062ea5c3
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
2 changed files with 9 additions and 9 deletions

View file

@ -16,7 +16,7 @@ module Admin
end end
def verify_user_admin def verify_user_admin
if (current_user.nil?) if current_user.nil?
redirect_to sign_in_path redirect_to sign_in_path
return false return false
end end
@ -26,5 +26,13 @@ module Admin
raise CanCan::AccessDenied.new('You are not authorized to access this page.') raise CanCan::AccessDenied.new('You are not authorized to access this page.')
end end
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
end end

View file

@ -115,14 +115,6 @@ module ApplicationHelper
conference.event_types.map { |et| et.title.pluralize }.to_sentence conference.event_types.map { |et| et.title.pluralize }.to_sentence
end 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) def rescheduling_hint(affected_event_count)
if affected_event_count > 0 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." "You have #{affected_event_count} scheduled #{'event'.pluralize(affected_event_count)}. Changing the conference hours will unschedule those scheduled outside the conference hours."