Skip to content

Commit

Permalink
Added missing validator to updateSetup method
Browse files Browse the repository at this point in the history
- This is the code corresponding to processArgs function in v1 authentication.updateSetup method
  • Loading branch information
naz committed Jul 30, 2019
1 parent c7a836b commit 589b78d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/server/api/v2/utils/validators/input/index.js
Expand Up @@ -3,6 +3,10 @@ module.exports = {
return require('./passwordreset');
},

get setup() {
return require('./setup');
},

get posts() {
return require('./posts');
},
Expand Down
12 changes: 12 additions & 0 deletions 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')});
}
}
};

0 comments on commit 589b78d

Please sign in to comment.