Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant variables #397

Merged
merged 2 commits into from Jun 12, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/clientManager.js
Expand Up @@ -125,10 +125,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) {
Expand Down
3 changes: 1 addition & 2 deletions src/command-line/reset.js
Expand Up @@ -23,8 +23,7 @@ program
return;
}
var salt = bcrypt.genSaltSync(8);
var hash = bcrypt.hashSync(password, salt);
user.password = hash;
user.password = bcrypt.hashSync(password, salt);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well get rid of the salt one while at it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't want to take the change too far, but if it's wanted, sure.

fs.writeFileSync(
file,
JSON.stringify(user, null, " ")
Expand Down