Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
Ember-ruby committed Jun 29, 2024
1 parent 9c3c4c4 commit 4cf4e3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/api/v1/timelines/public_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

class Api::V1::Timelines::PublicController < Api::V1::Timelines::BaseController
before_action :require_user!, only: [:show], if: :require_auth?
before_action :require_user!, only: [:show], if: :require_auth_local? && !truthy_param?(:local)
before_action :require_user!, only: [:show], if: :require_auth_remote? && !truthy_param?(:remote)
before_action :require_user!, only: [:show], if: :require_auth_local?
before_action :require_user!, only: [:show], if: :require_auth_remote?

PERMITTED_PARAMS = %i(local remote limit only_media allow_local_only).freeze

Expand All @@ -20,11 +20,11 @@ def require_auth?
end

def require_auth_local?
!Setting.timeline_preview_local
!Setting.timeline_preview_local && !truthy_param?(:local)
end

def require_auth_remote?
!Setting.timeline_preview_remote
!Setting.timeline_preview_remote && !truthy_param?(:remote)
end

def load_statuses
Expand Down

0 comments on commit 4cf4e3b

Please sign in to comment.