throw "No callback function was given".
No Callback function was given
bcrypt.hash()需要4个参数,
hash(data, salt, progress, cb)
The documentation is unclear on this: it states that data, salt and cb are required, which implies that progress isn't, but without it you'll get the error. Pass a null if you don't care about tracking progress:
bcrypt.hash(user.password, salt, null, function (err, hash) { ... })
The documentation is unclear on this: it states that data, salt and cb are required, which implies that progress isn't, but without it you'll get the error.
Pass a null if you don't care about tracking progress:
bcrypt.hash(user.password, salt, null, function (err, hash) { ... })