Remove redundant variables (#397)
This commit is contained in:
parent
643e07dead
commit
f8044bfc96
@ -122,10 +122,8 @@ ClientManager.prototype.readUserConfig = function(name) {
|
|||||||
if (users.indexOf(name) === -1) {
|
if (users.indexOf(name) === -1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var user = {};
|
|
||||||
var data = fs.readFileSync(Helper.getUserConfigPath(name), "utf-8");
|
var data = fs.readFileSync(Helper.getUserConfigPath(name), "utf-8");
|
||||||
user = JSON.parse(data);
|
return JSON.parse(data);
|
||||||
return user;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ClientManager.prototype.removeUser = function(name) {
|
ClientManager.prototype.removeUser = function(name) {
|
||||||
|
@ -22,9 +22,7 @@ program
|
|||||||
if (err) {
|
if (err) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var salt = bcrypt.genSaltSync(8);
|
user.password = bcrypt.hashSync(password, bcrypt.genSaltSync(8));
|
||||||
var hash = bcrypt.hashSync(password, salt);
|
|
||||||
user.password = hash;
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
file,
|
file,
|
||||||
JSON.stringify(user, null, " ")
|
JSON.stringify(user, null, " ")
|
||||||
|
Loading…
Reference in New Issue
Block a user