Added missing validator to updateSetup method

- This is the code corresponding to processArgs function in v1 authentication.updateSetup method
This commit is contained in:
Nazar Gargol 2019-07-30 16:37:32 +02:00
parent c7a836b926
commit 589b78d575
2 changed files with 16 additions and 0 deletions

View File

@ -3,6 +3,10 @@ module.exports = {
return require('./passwordreset'); return require('./passwordreset');
}, },
get setup() {
return require('./setup');
},
get posts() { get posts() {
return require('./posts'); return require('./posts');
}, },

View File

@ -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')});
}
}
};