From 9fcdad31421709d64ccf7b5f309ff46c1d4c9e46 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 13 Sep 2023 17:56:34 +0200 Subject: [PATCH] Stop using deprecated chrono::DateTime::from_utc method --- crates/handlers/src/upstream_oauth2/cookie.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/handlers/src/upstream_oauth2/cookie.rs b/crates/handlers/src/upstream_oauth2/cookie.rs index aa4a797c7..f8ffd6cf6 100644 --- a/crates/handlers/src/upstream_oauth2/cookie.rs +++ b/crates/handlers/src/upstream_oauth2/cookie.rs @@ -14,7 +14,7 @@ // TODO: move that to a standalone cookie manager -use chrono::{DateTime, Duration, NaiveDateTime, Utc}; +use chrono::{DateTime, Duration, NaiveDateTime, TimeZone, Utc}; use mas_axum_utils::cookies::CookieJar; use mas_router::PostAuthAction; use mas_storage::Clock; @@ -45,7 +45,7 @@ impl Payload { let Some(when) = NaiveDateTime::from_timestamp_millis(ts) else { return true; }; - let when = DateTime::from_utc(when, Utc); + let when = Utc.from_utc_datetime(&when); let max_age = Duration::seconds(SESSION_MAX_TIME_SECS); now - when > max_age }