You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed this fantastic gem and used it successfully. But i noticed something that a would like to understand better.
The helper method render_report makes an Ajax call to ReportsKit::ReportsController#index. However this does not check if the user that made the request is logged in.
Infact i can make the request to /reports_kit/reports.json?report_params[key]=my_key_here&properties={"format":"table","ui_filters":{}}
with or without authentication. With context_params we can send also an arbitrary user ID but again, if we provide the right ID we would see that user's data without actually logging in.
How can we check if user is logged in when this Ajax call happens? thanks.
The text was updated successfully, but these errors were encountered:
I came out with this solution:
I create an initializer file reports.rb and put inside it
ReportsKit::BaseController.class_eval do
# this is a module where i have all methods that checks for authentication
include AuthenticatedSystem
# now i can use my login_required method
before_action :login_required
end
Hi everyone,
I installed this fantastic gem and used it successfully. But i noticed something that a would like to understand better.
The helper method render_report makes an Ajax call to ReportsKit::ReportsController#index. However this does not check if the user that made the request is logged in.
Infact i can make the request to
/reports_kit/reports.json?report_params[key]=my_key_here&properties={"format":"table","ui_filters":{}}
with or without authentication. With context_params we can send also an arbitrary user ID but again, if we provide the right ID we would see that user's data without actually logging in.
How can we check if user is logged in when this Ajax call happens? thanks.
The text was updated successfully, but these errors were encountered: