0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Replaced i18n.t w/ tpl helper in authentication.js (#13402)

refs: #13380
This commit is contained in:
Ania Kowalska 2021-10-04 10:54:15 +02:00 committed by GitHub
parent 78d0644d78
commit 506f26b5ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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