mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
only exposing password at setup end if one is autogenerated
This commit is contained in:
@@ -335,7 +335,7 @@ function createAdmin(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Groups.join('administrators', uid, function(err) {
|
Groups.join('administrators', uid, function(err) {
|
||||||
callback(err, results);
|
callback(err, password ? results : undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -362,7 +362,7 @@ function createAdmin(callback) {
|
|||||||
prompt.get(questions, success);
|
prompt.get(questions, success);
|
||||||
} else {
|
} else {
|
||||||
// If automated setup did not provide a user password, generate one, it will be shown to the user upon setup completion
|
// If automated setup did not provide a user password, generate one, it will be shown to the user upon setup completion
|
||||||
if (!install.values.hasOwnProperty('admin:password')) {
|
if (!install.values.hasOwnProperty('admin:password') && !nconf.get('admin:password')) {
|
||||||
process.stdout.write('Password was not provided during automated setup, generating one...\n')
|
process.stdout.write('Password was not provided during automated setup, generating one...\n')
|
||||||
password = utils.generateUUID().slice(0, 8);
|
password = utils.generateUUID().slice(0, 8);
|
||||||
}
|
}
|
||||||
@@ -370,8 +370,8 @@ function createAdmin(callback) {
|
|||||||
var results = {
|
var results = {
|
||||||
username: install.values['admin:username'] || 'admin',
|
username: install.values['admin:username'] || 'admin',
|
||||||
email: install.values['admin:email'] || '',
|
email: install.values['admin:email'] || '',
|
||||||
password: install.values['admin:password'] || password,
|
password: install.values['admin:password'] || nconf.get('admin:password') || password,
|
||||||
'password:confirm': install.values['admin:password:confirm'] || password
|
'password:confirm': install.values['admin:password:confirm'] || nconf.get('admin:password') || password
|
||||||
};
|
};
|
||||||
|
|
||||||
success(null, results);
|
success(null, results);
|
||||||
|
|||||||
Reference in New Issue
Block a user