diff options
Diffstat (limited to 'app/controllers/public_timelines_controller.rb')
-rw-r--r-- | app/controllers/public_timelines_controller.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/app/controllers/public_timelines_controller.rb b/app/controllers/public_timelines_controller.rb index c5fe789f4..eb5bb191b 100644 --- a/app/controllers/public_timelines_controller.rb +++ b/app/controllers/public_timelines_controller.rb @@ -4,25 +4,17 @@ class PublicTimelinesController < ApplicationController before_action :set_pack layout 'public' - before_action :check_enabled + before_action :authenticate_user!, if: :whitelist_mode? + before_action :require_enabled! before_action :set_body_classes before_action :set_instance_presenter - def show - respond_to do |format| - format.html do - @initial_state_json = ActiveModelSerializers::SerializableResource.new( - InitialStatePresenter.new(settings: { known_fediverse: Setting.show_known_fediverse_at_about_page }, token: current_session&.token), - serializer: InitialStateSerializer - ).to_json - end - end - end + def show; end private - def check_enabled - raise ActiveRecord::RecordNotFound unless Setting.timeline_preview + def require_enabled! + not_found unless Setting.timeline_preview end def set_body_classes |