Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(function (salt) {
return bcrypt.hashAsync(user.password, salt)
.then(function (hash) {
user.password = hash;
});
})
.catch(function (err) {
async function hash_password(password)
{
const salt = await bcrypt.genSaltAsync(10)
return await bcrypt.hashAsync(password, salt)
}
static hashPassword(password) {
password = this.getPasswordString(password);
return bcrypt.hashAsync(password, saltRounds);
}
async function hash_password(password)
{
const salt = await bcrypt.genSaltAsync(10)
return await bcrypt.hashAsync(password, salt)
}