diff --git a/app/Models/User.js b/app/Models/User.js index 1740431..b046866 100644 --- a/app/Models/User.js +++ b/app/Models/User.js @@ -11,7 +11,7 @@ class User extends Model { * A hook to hash the user password before saving * it to the database. */ - this.addHook('beforeCreate', async (userInstance) => { + this.addHook('beforeSave', async (userInstance) => { if (userInstance.dirty.password) { userInstance.password = await Hash.make(userInstance.password) }