diff --git a/src/auth0/token.rs b/src/auth0/token.rs index f2b663c..0871e3b 100644 --- a/src/auth0/token.rs +++ b/src/auth0/token.rs @@ -54,7 +54,7 @@ impl Token { // the exact issued_at (iat) and expiration (exp) // reference: https://www.iana.org/assignments/jwt/jwt.xhtml let issue_date: DateTime = Utc::now(); - let expire_date: DateTime = Utc::now() + Duration::seconds(response.expires_in as i64); + let expire_date: DateTime = Utc::now() + Duration::try_seconds(response.expires_in as i64).unwrap_or(Duration::max_value()); Ok(Self { token: access_token,