mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 07:10:11 +00:00
Update models.md
This commit is contained in:
parent
90e1c6dafe
commit
4ed7ad2064
@ -651,12 +651,11 @@ module.exports = {
|
|||||||
* Triggered before user creation.
|
* Triggered before user creation.
|
||||||
*/
|
*/
|
||||||
beforeCreate: async (model, attrs, options) => {
|
beforeCreate: async (model, attrs, options) => {
|
||||||
// Hash password.
|
// Hash password.
|
||||||
const passwordHashed = await strapi.api.user.services.user.hashPassword(model.attributes.password);
|
const passwordHashed = await strapi.api.user.services.user.hashPassword(model.attributes.password);
|
||||||
|
|
||||||
// Set the password.
|
// Set the password.
|
||||||
model.set('password', passwordHashed);
|
model.set('password', passwordHashed);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user