Merge pull request #5283 from pichalite/setup-password-check

Check password length on setup and prompt again
v1.18.x
psychobunny 8 years ago committed by GitHub
commit 10cffb0b54

@ -220,9 +220,10 @@ function createAdministrator(next) {
} }
function createAdmin(callback) { function createAdmin(callback) {
var User = require('./user'), var User = require('./user');
Groups = require('./groups'), var Groups = require('./groups');
password; var password;
var meta = require('./meta');
winston.warn('No administrators have been detected, running initial user setup\n'); winston.warn('No administrators have been detected, running initial user setup\n');
@ -262,6 +263,12 @@ function createAdmin(callback) {
winston.warn("Passwords did not match, please try again"); winston.warn("Passwords did not match, please try again");
return retryPassword(results); return retryPassword(results);
} }
if (results.password.length < meta.config.minimumPasswordLength) {
winston.warn("Password too short, please try again");
return retryPassword(results);
}
var adminUid; var adminUid;
async.waterfall([ async.waterfall([
function (next) { function (next) {

Loading…
Cancel
Save