mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
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:
parent
fc55089266
commit
eca69da254
@ -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)
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user