about summary refs log tree commit diff
path: root/app/controllers/api/v1/instances/privacy_policies_controller.rb
blob: dbd69f54d4ab481da5a22640cb85851cec8353f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

class Api::V1::Instances::PrivacyPoliciesController < Api::BaseController
  skip_before_action :require_authenticated_user!, unless: :whitelist_mode?

  before_action :set_privacy_policy

  def show
    expires_in 1.day, public: true
    render json: @privacy_policy, serializer: REST::PrivacyPolicySerializer
  end

  private

  def set_privacy_policy
    @privacy_policy = PrivacyPolicy.current
  end
end