0
0
Fork 0

Redirect non-logged-in user to owner statuses on single user mode (#19333)

This commit is contained in:
Yamagishi Kazutoshi 2022-10-13 04:07:30 +09:00 committed by GitHub
parent 5f6c0d63e3
commit 7afc6a630c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 77 additions and 20 deletions

View file

@ -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')