You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-09 04:22:45 +03:00
Upgrade chrono and replace deprecated methods usage
This commit is contained in:
@@ -69,7 +69,13 @@ async fn verify_email(
|
||||
// Save the verification code in the database
|
||||
let verification = repo
|
||||
.user_email()
|
||||
.add_verification_code(&mut rng, &clock, &user_email, Duration::hours(8), code)
|
||||
.add_verification_code(
|
||||
&mut rng,
|
||||
&clock,
|
||||
&user_email,
|
||||
Duration::try_hours(8).unwrap(),
|
||||
code,
|
||||
)
|
||||
.await?;
|
||||
|
||||
// And send the verification email
|
||||
|
@@ -337,7 +337,7 @@ where
|
||||
.as_secs()
|
||||
.try_into()
|
||||
.map_err(|e| StorageError::Database(Box::new(e)))?;
|
||||
let wait = chrono::Duration::seconds(wait);
|
||||
let wait = chrono::Duration::microseconds(wait * 1000 * 1000);
|
||||
// TODO: should we use a clock here?
|
||||
#[allow(clippy::disallowed_methods)]
|
||||
let run_at = Utc::now().add(wait);
|
||||
|
Reference in New Issue
Block a user