From 3a56c303f5866f3c23d63bbfdf7748a72140497e Mon Sep 17 00:00:00 2001 From: naisanzaa Date: Tue, 8 Oct 2024 00:21:05 +0800 Subject: [PATCH] google auth: fix refresh token if hasattr fails --- automon/integrations/google/auth/client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/automon/integrations/google/auth/client.py b/automon/integrations/google/auth/client.py index b4aa5066..0ffa75bc 100644 --- a/automon/integrations/google/auth/client.py +++ b/automon/integrations/google/auth/client.py @@ -66,9 +66,8 @@ def authenticate_oauth(self) -> bool: """authenticate web token""" creds = self.config.Credentials() - refresh_token = creds.refresh_token - if refresh_token: + if hasattr(creds, 'refresh_token'): try: creds.refresh(google.auth.transport.requests.Request()) logger.info(f'token refresh success')