Update models.md

This commit is contained in:
Johann Pinson 2018-03-16 15:54:53 +01:00 committed by GitHub
parent 90e1c6dafe
commit 4ed7ad2064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -651,12 +651,11 @@ module.exports = {
* Triggered before user creation.
*/
beforeCreate: async (model, attrs, options) => {
// Hash password.
const passwordHashed = await strapi.api.user.services.user.hashPassword(model.attributes.password);
// Hash password.
const passwordHashed = await strapi.api.user.services.user.hashPassword(model.attributes.password);
// Set the password.
model.set('password', passwordHashed);
});
// Set the password.
model.set('password', passwordHashed);
}
}
```