13+ Error: Data And Salt Arguments Required. Cpwd is null, and that's the reason for the error. Body.confirmpassword = bcrypt.hashsync(cpwd, 10);//**cpwd is null** as per the docs, data is required argument and.
The error says data and salt arguments required. Remove the arrow =>in bcrypt.hash(). It looks like your salt is correctly generated and you didn’t check if newuser.password === undefined, so here’s my.