Skip to content

Commit

Permalink
all you can do
Browse files Browse the repository at this point in the history
  • Loading branch information
seren5240 committed Mar 10, 2024
1 parent 91f000c commit 6b96044
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/auth/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ impl AuthInfo {

pub fn get_expiry(&self) -> Result<DateTime<Utc>> {
let payload = self.get_payload()?;
let expiry = DateTime::<Utc>::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::<Utc>::from_timestamp(payload.exp as i64, 0)
.ok_or(anyhow::anyhow!("Invalid timestamp"))?;
Ok(expiry)
}

Expand Down

0 comments on commit 6b96044

Please sign in to comment.