Barış Soner Uşaklı 2 years ago
parent e7d0040d17
commit e35b0a869f

@ -342,6 +342,14 @@ async function createAdmin() {
try { try {
User.isPasswordValid(results.password); User.isPasswordValid(results.password);
} catch (err) { } catch (err) {
const [namespace, key] = err.message.slice(2, -2).split(':', 2);
if (namespace && key && err.message.startsWith('[[') && err.message.endsWith(']]')) {
const lang = require(path.join(__dirname, `../public/language/en-GB/${namespace}`));
if (lang && lang[key]) {
err.message = lang[key];
}
}
winston.warn(`Password error, please try again. ${err.message}`); winston.warn(`Password error, please try again. ${err.message}`);
return await retryPassword(results); return await retryPassword(results);
} }

Loading…
Cancel
Save