mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #8533, validate and retry password during setup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user