Skip to content

Commit

Permalink
fix(types::Token): Don't panic if refresh_token is empty
Browse files Browse the repository at this point in the history
Service account tokens don't set the refresh_token. Checking the
access_token field should be sufficient.
  • Loading branch information
dermesser committed Sep 21, 2016
1 parent 943f57e commit ed0a3c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ed0a3c4

Please sign in to comment.