Replaced i18n.t w/ tpl in v2/authentication.js (#13496)

refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
LucasOe 2021-10-08 16:35:22 +02:00 committed by GitHub
parent fc55089266
commit eca69da254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,16 @@
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');
const auth = require('../../services/auth');
const invitations = require('../../services/invitations');
const messages = {
notTheBlogOwner: 'You are not the site owner.'
};
module.exports = {
docName: 'authentication',
@ -47,7 +51,9 @@ 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)
});
}
});
},