{"record":{"id":"87b0ce086b0d4159","repo":"fatfreecrm/fat_free_crm","slug":"actioncontroller-invalidauthenticitytoken","errorCode":null,"errorMessage":"ActionController::InvalidAuthenticityToken","messagePattern":"ActionController::InvalidAuthenticityToken","errorType":"exception","errorClass":"ActionController::InvalidAuthenticityToken","httpStatus":422,"severity":"error","filePath":"app/controllers/application_controller.rb","lineNumber":82,"sourceCode":"  rescue_from ArgumentError do |exception|\n    if request.format.html? && exception.message == \"invalid base64\"\n      request.reset_session\n      redirect_to login_path\n    else\n      raise(exception)\n    end\n  end\n\n  private\n\n  #\n  # In rails 3, the default behaviour for handle_unverified_request is to delete the session\n  # and continue executing the request. However, we use cookie based authentication and need\n  # to halt proceedings. In Rails 4, use \"protect_from_forgery with: :exception\"\n  # See http://blog.nvisium.com/2014/09/understanding-protectfromforgery.html for more details.\n  #----------------------------------------------------------------------------\n  def handle_unverified_request\n    raise ActionController::InvalidAuthenticityToken unless ENV.fetch('CODESPACE_NAME', nil) && Rails.env.development?\n  end\n\n  #\n  # Takes { related: 'campaigns/7' } or { related: '5' }\n  #   and returns array of object ids that should be excluded from search\n  #   assumes controller_name is a method on 'related' class that returns a collection\n  #----------------------------------------------------------------------------\n  def auto_complete_ids_to_exclude(related)\n    return [] if related.blank?\n    return [related.to_i].compact unless related.index('/')\n\n    related_class, id = related.split('/')\n    obj = related_class.classify.constantize.find_by_id(id)\n    if obj&.respond_to?(controller_name)\n      obj.send(controller_name).map(&:id)\n    else\n      []\n    end","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/fatfreecrm/fat_free_crm/blob/3bb64ca0d59d9ad46ea28129481d2a979d2a8de5/app/controllers/application_controller.rb#L64-L100","documentation":"Error \"ActionController::InvalidAuthenticityToken\" thrown in fatfreecrm/fat_free_crm.","triggerScenarios":"Thrown at app/controllers/application_controller.rb:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3bb64ca0d59d9ad46ea28129481d2a979d2a8de5","analyzedAt":"2026-08-23T09:22:43.510Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}