Open
Description
Sorry for my English. But the document is lack about using asynchronous programming.
So, I was tried with below code
processors: {
async password (value) {
const hashed = await bcrypt.hashSync(value, Number(process.env.SALT_ROUND))
return hashed
}
}
In database will not set any data as hashed
resolve on await
statement. But instead it's work with return promise then processors will resolve itself.
processors: {
password (value) {
return bcrypt.hashSync(value, Number(process.env.SALT_ROUND))
}
}
Thanks.