diff --git a/core/server/api/v3/session.js b/core/server/api/v3/session.js index a6c82011eb..f69a9af77c 100644 --- a/core/server/api/v3/session.js +++ b/core/server/api/v3/session.js @@ -1,10 +1,14 @@ const Promise = require('bluebird'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const models = require('../../models'); const auth = require('../../services/auth'); const api = require('./index'); +const messages = { + accessDenied: 'Access denied.' +}; + const session = { read(frame) { /* @@ -20,7 +24,7 @@ const session = { if (!object || !object.username || !object.password) { return Promise.reject(new errors.UnauthorizedError({ - message: i18n.t('errors.middleware.auth.accessDenied') + message: tpl(messages.accessDenied) })); } @@ -40,7 +44,7 @@ const session = { }).catch(async (err) => { if (!errors.utils.isIgnitionError(err)) { throw new errors.UnauthorizedError({ - message: i18n.t('errors.middleware.auth.accessDenied'), + message: tpl(messages.accessDenied), err }); }