From 506f26b5ce0eed6a482d0c47f088676d65303e71 Mon Sep 17 00:00:00 2001 From: Ania Kowalska <63072419+akowalska622@users.noreply.github.com> Date: Mon, 4 Oct 2021 10:54:15 +0200 Subject: [PATCH] Replaced i18n.t w/ tpl helper in authentication.js (#13402) refs: #13380 --- core/server/api/canary/authentication.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)}); } }); },