Sets the email verification information for the user and updates it in the database. This method is used to record the timestamp when the email verification was sent and generate a unique verification token for the user. # Errors when has DB query error
(
mut self,
db: &DatabaseConnection,
)
| 207 | /// |
| 208 | /// when has DB query error |
| 209 | pub async fn set_email_verification_sent( |
| 210 | mut self, |
| 211 | db: &DatabaseConnection, |
| 212 | ) -> ModelResult<Model> { |
| 213 | self.email_verification_sent_at = ActiveValue::set(Some(Local::now().naive_local())); |
| 214 | self.email_verification_token = ActiveValue::Set(Some(Uuid::new_v4().to_string())); |
| 215 | Ok(self.update(db).await?) |
| 216 | } |
| 217 | |
| 218 | /// Sets the information for a reset password request, |
| 219 | /// generates a unique reset password token, and updates it in the |