Skip to content

A platform for community discussion. Free, open, simple.

DEV: Include `login_required` attribute in basic info endpoint (#14064)

Penar Musaraj08a3aa546b8b
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb
index c2df1759cea..734036cd69e 100644
--- a/app/controllers/site_controller.rb
+++ b/app/controllers/site_controller.rb
@@ -34,7 +34,8 @@ class SiteController < ApplicationController
title: SiteSetting.title,
description: SiteSetting.site_description,
header_primary_color: ColorScheme.hex_for_name('header_primary') || '333333',
- header_background_color: ColorScheme.hex_for_name('header_background') || 'ffffff'
+ header_background_color: ColorScheme.hex_for_name('header_background') || 'ffffff',
+ login_required: SiteSetting.login_required
}
if mobile_logo_url = SiteSetting.site_mobile_logo_url.presence
diff --git a/spec/requests/site_controller_spec.rb b/spec/requests/site_controller_spec.rb
index 86c9b9e7ff5..b4c3c9a0c30 100644
--- a/spec/requests/site_controller_spec.rb
+++ b/spec/requests/site_controller_spec.rb
@@ -29,6 +29,7 @@ describe SiteController do
expect(json["mobile_logo_url"]).to eq(expected_url)
expect(json["header_primary_color"]).to eq("333333")
expect(json["header_background_color"]).to eq("ffffff")
+ expect(json["login_required"]).to eq(true)
end
end