Remove redundant variables (#397)

This commit is contained in:
Daniel 2016-06-12 07:43:35 +01:00 committed by Pavel Djundik
parent 643e07dead
commit f8044bfc96
2 changed files with 2 additions and 6 deletions

View file

@ -122,10 +122,8 @@ ClientManager.prototype.readUserConfig = function(name) {
if (users.indexOf(name) === -1) {
return false;
}
var user = {};
var data = fs.readFileSync(Helper.getUserConfigPath(name), "utf-8");
user = JSON.parse(data);
return user;
return JSON.parse(data);
};
ClientManager.prototype.removeUser = function(name) {

View file

@ -22,9 +22,7 @@ program
if (err) {
return;
}
var salt = bcrypt.genSaltSync(8);
var hash = bcrypt.hashSync(password, salt);
user.password = hash;
user.password = bcrypt.hashSync(password, bcrypt.genSaltSync(8));
fs.writeFileSync(
file,
JSON.stringify(user, null, " ")