Sets the information for a reset password request, generates a unique reset password token, and updates it in the database. This method records the timestamp when the reset password token is sent and generates a unique token for the user. # Arguments # Errors when has DB query error
(mut self, db: &DatabaseConnection)
| 228 | /// |
| 229 | /// when has DB query error |
| 230 | pub async fn set_forgot_password_sent(mut self, db: &DatabaseConnection) -> ModelResult<Model> { |
| 231 | self.reset_sent_at = ActiveValue::set(Some(Local::now().naive_local())); |
| 232 | self.reset_token = ActiveValue::Set(Some(Uuid::new_v4().to_string())); |
| 233 | Ok(self.update(db).await?) |
| 234 | } |
| 235 | |
| 236 | /// Records the verification time when a user verifies their |
| 237 | /// email and updates it in the database. |