mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Name field should appear in the signup form for login-required sites (#30634)
Meta topic: https://meta.discourse.org/t/full-name-at-sign-up-went-missing/345662/17?u=osama The preloaded `site` object for anons on login-required sites is a stripped down version of the full object with just a specific set of attributes and doesn't use the site serializer. This results in the `full_name_required_for_signup` and `full_name_visible_in_signup` attributes not making it to the client app when a login-required site is accessed by an anon, causing the name field in the signup form to not be rendered, even when it's required. This commit includes those attributes in the stripped down version of the `site` object that's used for anons on login-required sites.
This commit is contained in:
@@ -384,11 +384,11 @@ class SiteSerializer < ApplicationSerializer
|
||||
end
|
||||
|
||||
def full_name_required_for_signup
|
||||
SiteSetting.enable_names && SiteSetting.full_name_requirement == "required_at_signup"
|
||||
Site.full_name_required_for_signup
|
||||
end
|
||||
|
||||
def full_name_visible_in_signup
|
||||
SiteSetting.enable_names && SiteSetting.full_name_requirement != "hidden_at_signup"
|
||||
Site.full_name_visible_in_signup
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user