mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Update models.md
This commit is contained in:
parent
90e1c6dafe
commit
4ed7ad2064
@ -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);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user