0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Use member cookie on comment API

refs https://github.com/TryGhost/Team/issues/1664
This commit is contained in:
Hannah Wolfe 2022-07-05 14:15:00 +02:00 committed by Simon Backx
parent 42fc272433
commit f5ccec70b6

View file

@ -6,6 +6,7 @@ const express = require('../../../shared/express');
const urlUtils = require('../../../shared/url-utils');
const sentry = require('../../../shared/sentry');
const routes = require('./routes');
const membersService = require('../../../server/services/members');
module.exports = function setupCommentsApp() {
debug('Comments App setup start');
@ -17,6 +18,9 @@ module.exports = function setupCommentsApp() {
commentsApp.use(bodyParser.json({limit: '50mb'}));
// Global handling for member session, ensures a member is logged in to the frontend
commentsApp.use(membersService.middleware.loadMemberSession);
// Routing
commentsApp.use('/api/', routes());