@@ -22,7 +22,7 @@ | |||
"jshint": "^2.8.0", | |||
"mlogger": "^1.1.0", | |||
"pg": "^4.4.0", | |||
"scrypt": "^4.0.7", | |||
"scrypt": "^5.1.0", | |||
"uglify-js": "^2.4.24", | |||
"uglifycss": "0.0.15", | |||
"wrench": "^1.5.8" |
@@ -11,8 +11,8 @@ module.exports = function(ctx) { | |||
if (!/^[a-zA-Z0-9_\-]+$/.test(data.username)) | |||
return ctx.fail("Username contains illegal characters."); | |||
var params = scrypt.params(ctx.conf.scrypt.maxtime); | |||
scrypt.hash(new Buffer(data.password), params, function(err, hash) { | |||
var params = scrypt.paramsSync(ctx.conf.scrypt.maxtime); | |||
scrypt.kdf(new Buffer(data.password), params, function(err, hash) { | |||
if (err) | |||
return ctx.fail(err); | |||
@@ -28,7 +28,7 @@ module.exports = function(ctx) { | |||
ctx.login(user.username, user.id); | |||
scrypt.verify( | |||
scrypt.verifyKdf( | |||
new Buffer(user.pass_hash, "hex"), | |||
new Buffer(ctx.postData.data.password), | |||
function(err, success) { |