From 6b96044358a52666103e4d75d4ea471b1ab73db0 Mon Sep 17 00:00:00 2001 From: Seren Kwok Date: Sun, 10 Mar 2024 12:06:17 +0000 Subject: [PATCH] all you can do --- crates/auth/src/info.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/auth/src/info.rs b/crates/auth/src/info.rs index ee479ca55..eef6d9cfc 100644 --- a/crates/auth/src/info.rs +++ b/crates/auth/src/info.rs @@ -32,11 +32,8 @@ impl AuthInfo { pub fn get_expiry(&self) -> Result> { let payload = self.get_payload()?; - let expiry = DateTime::::from_naive_utc_and_offset( - chrono::NaiveDateTime::from_timestamp_opt(payload.exp as i64, 0) - .ok_or(anyhow::anyhow!("Invalid timestamp"))?, - Utc, - ); + let expiry = DateTime::::from_timestamp(payload.exp as i64, 0) + .ok_or(anyhow::anyhow!("Invalid timestamp"))?; Ok(expiry) }