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
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