privacy_policies_controller.rb 438 B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. class Api::V1::Instances::PrivacyPoliciesController < Api::BaseController
  3. skip_before_action :require_authenticated_user!, unless: :whitelist_mode?
  4. before_action :set_privacy_policy
  5. def show
  6. expires_in 1.day, public: true
  7. render json: @privacy_policy, serializer: REST::PrivacyPolicySerializer
  8. end
  9. private
  10. def set_privacy_policy
  11. @privacy_policy = PrivacyPolicy.current
  12. end
  13. end