code: def _check_app_is_valid(client):
      
      try:
          if 'refresh_token' in client.creds:
              client.exchange_refresh_token()
          else:
              existing.get_token_info()
          return True
      except TokenEndpointError as e:
          return False
docs: Check to see if the app has valid creds.