mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-01-07 03:31:31 +01:00
fix(types::Token): Don't panic if refresh_token is empty
Service account tokens don't set the refresh_token. Checking the access_token field should be sufficient.
This commit is contained in:
@@ -200,7 +200,7 @@ impl Token {
|
||||
/// # Panics
|
||||
/// * if our access_token is unset
|
||||
pub fn expired(&self) -> bool {
|
||||
if self.access_token.len() == 0 || self.refresh_token.len() == 0 {
|
||||
if self.access_token.len() == 0 {
|
||||
panic!("called expired() on unset token");
|
||||
}
|
||||
self.expiry_date() <= UTC::now()
|
||||
|
||||
Reference in New Issue
Block a user