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:
parent
78d0644d78
commit
506f26b5ce
1 changed files with 6 additions and 2 deletions
|
@ -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)});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue