diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2022-10-13 04:07:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 21:07:30 +0200 |
commit | 7afc6a630c76fb071bd189af3ac1366efc82f819 (patch) | |
tree | d9d1b096db2c9fd7c3c8e766ee768611e21c7630 /app/helpers | |
parent | 5f6c0d63e3f9e90d57204126409bbda539e352d8 (diff) |
Redirect non-logged-in user to owner statuses on single user mode (#19333)
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 23884fbd4..9cc34cab6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -211,6 +211,10 @@ module ApplicationHelper state_params[:admin] = Account.find_local(Setting.site_contact_username.strip.gsub(/\A@/, '')) end + if single_user_mode? + state_params[:owner] = Account.local.without_suspended.where('id > 0').first + end + json = ActiveModelSerializers::SerializableResource.new(InitialStatePresenter.new(state_params), serializer: InitialStateSerializer).to_json # rubocop:disable Rails/OutputSafety content_tag(:script, json_escape(json).html_safe, id: 'initial-state', type: 'application/json') |