Properly set the project root for the gdrive token

This commit is contained in:
Eric Hare 2025-09-08 11:08:45 -07:00
parent 1096ef4cd0
commit b9da6437f8
No known key found for this signature in database
GPG key ID: A73DF73724270AB7

View file

@ -102,9 +102,8 @@ class GoogleDriveConnector(BaseConnector):
client_secret = config.get("client_secret") or env_client_secret client_secret = config.get("client_secret") or env_client_secret
# Token file default (so callback & workers dont need to pass it) # Token file default (so callback & workers dont need to pass it)
token_file = config.get("token_file") or os.getenv("GOOGLE_DRIVE_TOKEN_FILE") project_root = Path(__file__).resolve().parent.parent.parent.parent
if not token_file: token_file = config.get("token_file") or str(project_root / "google_drive_token.json")
token_file = str(Path.home() / ".config" / "openrag" / "google_drive" / "token.json")
Path(token_file).parent.mkdir(parents=True, exist_ok=True) Path(token_file).parent.mkdir(parents=True, exist_ok=True)
if not isinstance(client_id, str) or not client_id.strip(): if not isinstance(client_id, str) or not client_id.strip():