mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 23:37:43 +03:00
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:
parent
d2bc812983
commit
242f7ef4c8
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user