Sunday, 9 April 2017

bcrypt.hash doesn't call its callback

For some reason the bcrypt.hash method hangs up and never calls its callback.

bcrypt.genSalt(29, function(err, salt) {
    if (err) {
        res.json({ success: false, msg: err.message });
    } else {
        bcrypt.hash(req.body.password, salt, function (err, hash) {
            // This function is never called
            res.json({ success: true });
        });
    }
});

Any suggestions?



via Don Tomato

No comments:

Post a Comment