app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def append_info_to_payload(payload)
    super
    payload[:request_id] = request.uuid
    payload[:user_id] = current_user.id if current_user
    if request.env['HTTP_CF_CONNECTING_IP']
      payload[:ip] = request.env['HTTP_CF_CONNECTING_IP']
    elsif request.env["HTTP_X_FORWARDED_FOR"]
      payload[:ip] = request.env["HTTP_X_FORWARDED_FOR"]
    else
      payload[:ip] = request.env['REMOTE_ADDR']
    end
  end
def append_info_to_payload ( payload ) super payload [ :request_id ] = request . uuid payload [ :user_id ] = current_user . id if current_user if request . env [ 'HTTP_CF_CONNECTING_IP' ] payload [ :ip ] = request . env [ 'HTTP_CF_CONNECTING_IP' ] elsif request . env [ "HTTP_X_FORWARDED_FOR" ] payload [ :ip ] = request . env [ "HTTP_X_FORWARDED_FOR" ] else payload [ :ip ] = request . env [ 'REMOTE_ADDR' ] end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .
payload