fix: #8533, validate and retry password during setup

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 9e80a9efdd
commit 0d698a079e

@ -268,7 +268,6 @@ function createAdmin(callback) {
var User = require('./user');
var Groups = require('./groups');
var password;
var meta = require('./meta');
winston.warn('No administrators have been detected, running initial user setup\n');
@ -309,8 +308,10 @@ function createAdmin(callback) {
return retryPassword(results);
}
if (results.password.length < meta.config.minimumPasswordLength) {
winston.warn('Password too short, please try again');
try {
User.isPasswordValid(results.password);
} catch (err) {
winston.warn('Password error, please try again. ' + err.message);
return retryPassword(results);
}

Loading…
Cancel
Save