diff --git a/core/server/api/v2/utils/validators/input/index.js b/core/server/api/v2/utils/validators/input/index.js index 014b3d988e..ade462c797 100644 --- a/core/server/api/v2/utils/validators/input/index.js +++ b/core/server/api/v2/utils/validators/input/index.js @@ -3,6 +3,10 @@ module.exports = { return require('./passwordreset'); }, + get setup() { + return require('./setup'); + }, + get posts() { return require('./posts'); }, diff --git a/core/server/api/v2/utils/validators/input/setup.js b/core/server/api/v2/utils/validators/input/setup.js new file mode 100644 index 0000000000..3dc8dd32b9 --- /dev/null +++ b/core/server/api/v2/utils/validators/input/setup.js @@ -0,0 +1,12 @@ +const debug = require('ghost-ignition').debug('api:v2:utils:validators:input:updateSetup'); +const common = require('../../../../../lib/common'); + +module.exports = { + updateSetup(apiConfig, frame) { + debug('resetPassword'); + + if (!frame.options.context || !frame.options.context.user) { + throw new common.errors.NoPermissionError({message: common.i18n.t('errors.api.authentication.notTheBlogOwner')}); + } + } +};