Ghost/core/server/services/members/index.js
Fabien O'Carroll c101fd90d7
Removed lib/members in favour of packages (#10739)
* Installed `@tryghost/members-{api,auth-pages}`

no-issue

* Used @tryghost/members-auth-pages in member service

no-issue

* Used @tryghost/members-api in members service

no-issue

* Deleted core/server/lib/members

no-issue

* Fixed parent app tests

no-issue

Requiring the members api (via the `gateway` getter) was throwing an
error, so we stub out the members service getters
2019-05-08 14:08:25 +02:00

38 lines
1.2 KiB
JavaScript

const config = require('../../config/index.js');
const common = require('../../lib/common');
module.exports = {
get api() {
if (!config.get('enableDeveloperExperiments')) {
return {
apiRouter: function (req, res, next) {
return next(new common.errors.NotFoundError());
},
staticRouter: function (req, res, next) {
return next(new common.errors.NotFoundError());
},
ssr: {
exchangeTokenForSession: function () {
return Promise.reject(new common.errors.InternalServerError());
},
deleteSession: function () {
return Promise.reject(new common.errors.InternalServerError());
},
getMemberDataFromSession: function () {
return Promise.reject(new common.errors.InternalServerError());
}
}
};
}
return require('./api');
},
get authPages() {
return require('./authPages');
},
get gateway() {
return require('./api').staticRouter;
}
};