MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / set_forgot_password_sent

Method set_forgot_password_sent

examples/loco_starter/src/models/users.rs:230–234  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 1

forgotFunction · 0.45

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected