moved bcrpyt rounds to config file

This commit is contained in:
Baris Usakli
2013-07-10 11:51:15 -04:00
parent 93653e88df
commit d66aef7812
2 changed files with 49 additions and 48 deletions

View File

@@ -357,10 +357,7 @@ var utils = require('./../public/src/utils.js'),
return;
}
// round count should be variable somewhere instead of hardcoded here
// if an admin has the resources to up the round count, then making it easy for them to do so
// can't hurt
bcrypt.genSalt(10, function(err, salt) {
bcrypt.genSalt(config.bcrypt_rounds, function(err, salt) {
bcrypt.hash(password, salt, function(err, hash) {
callback(hash);
});
@@ -391,7 +388,7 @@ var utils = require('./../public/src/utils.js'),
}
User.onNewPostMade = function(uid, tid, pid, timestamp) {
User.addPostIdToUser(uid, pid)
User.addPostIdToUser(uid, pid);
User.incrementUserFieldBy(uid, 'postcount', 1);
User.setUserField(uid, 'lastposttime', timestamp);