diff --git a/src/gphotos_sync/authorize.py b/src/gphotos_sync/authorize.py index 488ad2f6..ea7b1441 100644 --- a/src/gphotos_sync/authorize.py +++ b/src/gphotos_sync/authorize.py @@ -2,6 +2,7 @@ from json import JSONDecodeError, dump, load from pathlib import Path from typing import List, Optional +from datetime import timezone from google_auth_oauthlib.flow import InstalledAppFlow from requests.adapters import HTTPAdapter @@ -104,7 +105,7 @@ def authorize(self): "refresh_token": flow.credentials.refresh_token, "token_type": "Bearer", "scope": flow.credentials.scopes, - "expires_at": flow.credentials.expiry.timestamp(), + "expires_at": flow.credentials.expiry.replace(tzinfo=timezone.utc).timestamp() } self.save_token(oauth2_token)