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
# Token file default (so callback & workers dont need to pass it)
token_file = config.get("token_file") or os.getenv("GOOGLE_DRIVE_TOKEN_FILE")
if not token_file:
token_file = str(Path.home() / ".config" / "openrag" / "google_drive" / "token.json")
project_root = Path(__file__).resolve().parent.parent.parent.parent
token_file = config.get("token_file") or str(project_root / "google_drive_token.json")
Path(token_file).parent.mkdir(parents=True, exist_ok=True)
if not isinstance(client_id, str) or not client_id.strip():