diff --git a/app/assets/javascripts/discourse.js b/app/assets/javascripts/discourse.js index d05de2e48..094c4e9bf 100644 --- a/app/assets/javascripts/discourse.js +++ b/app/assets/javascripts/discourse.js @@ -227,7 +227,6 @@ Discourse = Ember.Application.createWithMixins(Discourse.Ajax, { **/ start: function() { Discourse.bindDOMEvents(); - Discourse.SiteSettings = PreloadStore.get('siteSettings'); Discourse.MessageBus.alwaysLongPoll = Discourse.Environment === "development"; Discourse.MessageBus.start(); Discourse.KeyValueStore.init("discourse_", Discourse.MessageBus); diff --git a/app/views/common/_discourse_javascript.html.erb b/app/views/common/_discourse_javascript.html.erb index bf1eea711..b980c8b1b 100644 --- a/app/views/common/_discourse_javascript.html.erb +++ b/app/views/common/_discourse_javascript.html.erb @@ -21,6 +21,7 @@ Discourse.BaseUrl = '<%= RailsMultisite::ConnectionManagement.current_hostname %>'; Discourse.BaseUri = '<%= Discourse::base_uri "/" %>'; Discourse.Environment = '<%= Rails.env %>'; + Discourse.SiteSettings.login_required && !Discourse.User.current(); Discourse.Router.map(function() { Discourse.routeBuilder.call(this); });