Skip to content

Commit

Permalink
fix: #8533, validate and retry password during setup
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jul 31, 2020
1 parent 9e80a9e commit 0d698a0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/install.js
Expand Up @@ -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');

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

Expand Down

0 comments on commit 0d698a0

Please sign in to comment.