Monday, 15 May 2017

Error:No callback function was given? [on hold]

It is showing the error in the node modules.Now how should I do this? C:\Users\Lenovo\newcontactapp\server\app\node_modules\bcrypt-nodejs\bCrypt.js:621 throw "No callback function was given." ^ No callback function was given.

I have used bcrypt-nodejs API in order to hash the password and save it to database.

A portion of my code where I have used bcrypt API.

bcrypt.genSalt(9, function (err, salt) {
        if (err) {
            return next(err);
        }
        bcrypt.hash(user.password, salt, function (err, hash) {
            if (err) {
                return next(err);
            }
            user.password = hash;
            console.log('changed user password',+JSON.stringify(user.password));
            next();
        });

Need Help.



via Aditya Jain

No comments:

Post a Comment