From 6b05056b057e8ecf7da7ba4d6538f9ea0f9ba9b0 Mon Sep 17 00:00:00 2001 From: Lewin Bormann Date: Thu, 13 Jun 2019 15:51:04 +0200 Subject: [PATCH] imp(expiry): Treat tokens with < 1 minute life left as expired. Fixes #78. --- src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.rs b/src/types.rs index 3ba1586..54606ad 100644 --- a/src/types.rs +++ b/src/types.rs @@ -248,7 +248,7 @@ impl Token { if self.access_token.len() == 0 { panic!("called expired() on unset token"); } - self.expiry_date() <= Utc::now() + self.expiry_date() - chrono::Duration::minutes(1) <= Utc::now() } /// Returns a DateTime object representing our expiry date.