zino-rs / zino

Next-generation framework for composable applications in Rust.
https://crates.io/crates/zino
MIT License
762 stars 52 forks source link

Password update question #128

Closed akelyasir closed 1 month ago

akelyasir commented 1 month ago

Hi @photino

When adding a new user, the specified password is correctly recorded in the database, that is, the encryption process works for the password field. However, the encryption process does not occur during the password update. Should we do this ourselves?

Thanks

photino commented 1 month ago

Hi @photino

When adding a new user, the specified password is correctly recorded in the database, that is, the encryption process works for the password field. However, the encryption process does not occur during the password update. Should we do this ourselves?

Thanks

The default encryption scheme of password is provided by https://docs.rs/zino-core/latest/zino_core/orm/trait.ModelHelper.html#method.encrypt_password It is used when adding a new user if you does not handle the password encryption manually. For updating the password, you should call this method first before saving it to the database.