diff --git a/app/Models/User.js b/app/Models/User.js index 265968c..1740431 100644 --- a/app/Models/User.js +++ b/app/Models/User.js @@ -12,7 +12,7 @@ class User extends Model { * it to the database. */ this.addHook('beforeCreate', async (userInstance) => { - if (userInstance.password) { + if (userInstance.dirty.password) { userInstance.password = await Hash.make(userInstance.password) } })