imp(expiry): Treat tokens with < 1 minute life left as expired.

Fixes #78.
This commit is contained in:
Lewin Bormann
2019-06-13 15:51:04 +02:00
parent 4cfbc6e5fc
commit 6b05056b05

View File

@@ -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.