Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const hashPasswordHook = function (user) {
return bcrypt.genSaltAsync(SALT_WORK_FACTOR)
.then(function (salt) {
return bcrypt.hashAsync(user.password, salt)
.then(function (hash) {
user.password = hash;
});
})
.catch(function (err) {
console.log('Password hook error:', err);
});
};
async function hash_password(password)
{
const salt = await bcrypt.genSaltAsync(10)
return await bcrypt.hashAsync(password, salt)
}
async function hash_password(password)
{
const salt = await bcrypt.genSaltAsync(10)
return await bcrypt.hashAsync(password, salt)
}