I am using nodejs library scrypt to hash my passwords.
scrypt.hash(new Buffer(data.password), scryptParameters, function(err, res) {
console.log(res);
//scrypt.verify(res, "incorrect password");
});
which works perfectly. But, the problem is when I uncomment the line to verify the hash (I have put it in the same function (and syncronously) just for the sake of simplicity)
The script just crashes without any errors! this is what I get in the console
/Users/foo/Documents/nodejs/wow/models/user.js:44
scrypt.verify(res, "incorrect password");
^
[object Object]
31 Jul 10:26:52 - [nodemon] app crashed - waiting for file changes before starting...
also it seems like it is trying to put some sort of object, that is [object Object]
. I am not console.log'ing it, as I get nothing in the console before uncommenting that line.
Anyone had the same problem? Thanks in advance.