Removed usage of res.isAdmin from private blogging app

no issue

- private blogging was once part of a single big express app, see: c1a2601514
- therefor we needed to differentiate if the request is for /api/v0.1 or for the actual site
- nowadays, we register apps only for the site express app
This commit is contained in:
kirrg001 2018-09-15 08:58:53 +02:00
parent d2bc812983
commit 242f7ef4c8
2 changed files with 1 additions and 7 deletions

View File

@ -40,7 +40,7 @@ privateBlogging = {
},
filterPrivateRoutes: function filterPrivateRoutes(req, res, next) {
if (res.isAdmin || !res.isPrivateBlog || req.url.lastIndexOf(privateRoute, 0) === 0) {
if (!res.isPrivateBlog || req.url.lastIndexOf(privateRoute, 0) === 0) {
return next();
}

View File

@ -83,12 +83,6 @@ describe('Private Blogging', function () {
req.session = {};
});
it('filterPrivateRoutes should call next if admin', function () {
res.isAdmin = true;
privateBlogging.filterPrivateRoutes(req, res, next);
next.called.should.be.true();
});
it('filterPrivateRoutes should call next if is the "private" route', function () {
req.path = req.url = '/private/';
privateBlogging.filterPrivateRoutes(req, res, next);