mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Replaced i18n w/ tpl in /core/server/api/v3/session.js (#13525)
refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
887caa299f
commit
8961785dfa
@ -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
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user