mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-06-06 11:11:39 +00:00
Stop using deprecated chrono::DateTime::from_utc method
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user