Files
fizzy/app/helpers/login_helper.rb
T
Mike Dalessio 3d523b84fc Explicitly use main_app for URL helpers
in controller concerns that are mixed into other engines' controllers. This prevents errors like:

> NoMethodError: undefined method 'session_menu_url' for an instance of ActiveStorage::DirectUploadsController

See also 912bb8a8 and 5ee10800
2025-12-11 12:55:32 -05:00

18 lines
319 B
Ruby

module LoginHelper
def login_url
main_app.new_session_path(script_name: nil)
end
def logout_url
main_app.new_session_path
end
def redirect_to_login_url
redirect_to login_url, allow_other_host: true
end
def redirect_to_logout_url
redirect_to logout_url, allow_other_host: true
end
end