~cytrogen/masto-fe

ref: 392c07f2bf01743fdbf92abb555a4c558c7f4a31 masto-fe/app/helpers/authorized_fetch_helper.rb -rw-r--r-- 355 bytes
392c07f2 — Claire Fix `Setting.authorized_fetch` not being properly taken into consideration (#26958) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

module AuthorizedFetchHelper
  def authorized_fetch_mode?
    ENV.fetch('AUTHORIZED_FETCH') { Setting.authorized_fetch && 'true' } == 'true' || Rails.configuration.x.limited_federation_mode
  end

  def authorized_fetch_overridden?
    ENV.key?('AUTHORIZED_FETCH') || Rails.configuration.x.limited_federation_mode
  end
end