0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Replaced i18n with tpl core/server/api/canary/session.js (#13487)

refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
Ayoub BERDEDDOUCH 2021-10-08 16:11:26 +02:00 committed by GitHub
parent a6833077a7
commit 3255c806f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
});
}