~cytrogen/masto-fe

ref: effe4728cf7adbefd9becf927cf4a34e3b337eb2 masto-fe/app/helpers/authorized_fetch_helper.rb -rw-r--r-- 355 bytes
effe4728 — github-actions[bot] New Crowdin Translations (automated) (#27005) 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