diff --git a/core/server/api/canary/authentication.js b/core/server/api/canary/authentication.js index c7d29332a3..5eddc202b0 100644 --- a/core/server/api/canary/authentication.js +++ b/core/server/api/canary/authentication.js @@ -1,7 +1,7 @@ const Promise = require('bluebird'); const api = require('./index'); const config = require('../../../shared/config'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const web = require('../../web'); const models = require('../../models'); @@ -14,6 +14,10 @@ const UsersService = require('../../services/users'); const userService = new UsersService({dbBackup, models, auth, apiMail, apiSettings}); const {deleteAllSessions} = require('../../services/auth/session'); +const messages = { + notTheBlogOwner: 'You are not the site owner.' +}; + module.exports = { docName: 'authentication', @@ -67,7 +71,7 @@ module.exports = { return models.User.findOne({role: 'Owner', status: 'all'}) .then((owner) => { if (owner.id !== frame.options.context.user) { - throw new errors.NoPermissionError({message: i18n.t('errors.api.authentication.notTheBlogOwner')}); + throw new errors.NoPermissionError({message: tpl(messages.notTheBlogOwner)}); } }); },