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 6ca5e4c308
commit bcca9b77bd

View File

@@ -216,7 +216,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.