Skip to content

Commit cf08d2c

Browse files
committed
security: when login is required don't return the site node in the preload store
1 parent 634e764 commit cf08d2c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/models/site.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ def cache_key
5555
end
5656

5757
def self.cached_json(guardian)
58+
59+
if guardian.anonymous? && SiteSetting.login_required
60+
return {}.to_json
61+
end
62+
5863
# Sam: bumping this way down, SiteSerializer will serialize post actions as well,
5964
# On my local this was not being flushed as post actions types changed, it turn this
6065
# broke local.

0 commit comments

Comments
 (0)