mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Protected members middleware with a labs check
no-issue This would have been creating a lot of noisy logs for sites without members enabled.
This commit is contained in:
parent
a3940ef9db
commit
531e217b82
1 changed files with 5 additions and 0 deletions
|
@ -11,6 +11,7 @@ const apps = require('../../services/apps');
|
|||
const constants = require('../../lib/constants');
|
||||
const storage = require('../../adapters/storage');
|
||||
const urlService = require('../../../frontend/services/url');
|
||||
const labsService = require('../../services/labs');
|
||||
const urlUtils = require('../../lib/url-utils');
|
||||
const sitemapHandler = require('../../../frontend/services/sitemap/handler');
|
||||
const themeMiddleware = require('../../../frontend/services/themes').middleware;
|
||||
|
@ -162,6 +163,10 @@ module.exports = function setupSiteApp(options = {}) {
|
|||
});
|
||||
});
|
||||
siteApp.use(function (req, res, next) {
|
||||
if (!labsService.isSet('members')) {
|
||||
req.member = null;
|
||||
return next();
|
||||
}
|
||||
membersService.ssr.getMemberDataFromSession(req, res).then((member) => {
|
||||
req.member = member;
|
||||
next();
|
||||
|
|
Loading…
Add table
Reference in a new issue