message: Optionally load expired tokens from the cache
  Adds a parameter to the `read_token_cache` function to allow loading expired tokens from the cache. This can be useful in cases where the user wants to access the refresh token stored in the token cache.
  Closes
diff: @@ -40,10 +40,10 @@ pub trait OAuthClient: BaseClient {
  /// This will return an error if the token couldn't be read (e.g. it's not
  /// available or the JSON is malformed). It may return `Ok(None)` if:
  ///
  - /// * The read token is expired
  /// * Its scopes don't match with the current client
  /// * The cached token is disabled in the config
  - async fn read_token_cache(&mut self) -> ClientResult<Option<Token>> {
  + /// * The read token is expired and `allow_expired` is false
  + async fn read_token_cache(&mut self, allow_expired: bool) -> ClientResult<Option<Token>> {
  if !self.get_config().token_cached {
  log::info!("Auth token cache read ignored (not configured)");
  return Ok(None);
  @@ -51,7 +51,7 @@ pub trait OAuthClient: BaseClient {
  log::info!("Reading auth token cache");
  let token = Token::from_cache(&self.get_config().cache_path)?;
  - if !self.get_oauth().scopes.is_subset(&token.scopes) || token.is_expired() {
  + if !self.get_oauth().scopes.is_subset(&token.scopes) || (token.is_expired() && !allow_expired) {
  // Invalid token, since it doesn't have at least the currently
  // required scopes or it's expired.
  Ok(None)
  