-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Blog-Post/server/utils/hashPassword.js
Lines 3 to 8 in ce45315
| const hashPassword = (password, callback) => { | |
| bcrypt.genSalt(10, (err, salt) => { | |
| if (err) { | |
| console.log(err); | |
| } else { | |
| bcrypt.hash(password, salt, callback); |
returning to bcrypt we can generate hash in one step, check bcryptjs hash api to auto-gen hash and salt, and again as this method return promise so try to avoid callbacks.
Reactions are currently unavailable