mirror of
https://github.com/discourse/discourse.git
synced 2026-08-26 21:27:16 -05:00
BUGFIX: JS error when login_required is enabled
This commit is contained in:
@@ -88,8 +88,7 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
||||
},
|
||||
|
||||
loginRequired: function() {
|
||||
return Discourse.SiteSettings.login_required &&
|
||||
!Discourse.User.current();
|
||||
return Discourse.SiteSettings.login_required && !Discourse.User.current();
|
||||
}.property(),
|
||||
|
||||
redirectIfLoginRequired: function(route) {
|
||||
|
||||
@@ -7,19 +7,18 @@
|
||||
Discourse.Route.buildRoutes(function() {
|
||||
var router = this;
|
||||
|
||||
// Generate static page routes
|
||||
_.each(Discourse.StaticController.PAGES, function (page) {
|
||||
router.route(page, { path: '/' + page });
|
||||
});
|
||||
|
||||
// Topic routes
|
||||
this.resource('topic', { path: '/t/:slug/:id' }, function() {
|
||||
this.route('fromParams', { path: '/' });
|
||||
this.route('fromParamsNear', { path: '/:nearPost' });
|
||||
});
|
||||
|
||||
// Generate static page routes
|
||||
_.each(Discourse.StaticController.PAGES, function (page) {
|
||||
router.route(page, { path: '/' + page });
|
||||
});
|
||||
|
||||
this.resource('discovery', { path: '/' }, function() {
|
||||
|
||||
router = this;
|
||||
|
||||
// top
|
||||
@@ -41,6 +40,7 @@ Discourse.Route.buildRoutes(function() {
|
||||
router.route(top + 'Category', { path: '/category/:parentSlug/:slug/l/top/' + period + '/more' });
|
||||
});
|
||||
|
||||
// filters
|
||||
Discourse.Site.currentProp('filters').forEach(function(filter) {
|
||||
router.route(filter, { path: '/' + filter });
|
||||
router.route(filter, { path: '/' + filter + '/more' });
|
||||
|
||||
Reference in New Issue
Block a user