diff --git a/skills/productivity/google-workspace/scripts/gws_bridge.py b/skills/productivity/google-workspace/scripts/gws_bridge.py index adecd33ad..7b5d351f8 100755 --- a/skills/productivity/google-workspace/scripts/gws_bridge.py +++ b/skills/productivity/google-workspace/scripts/gws_bridge.py @@ -25,6 +25,13 @@ def refresh_token(token_data: dict) -> dict: import urllib.parse import urllib.request + required_keys = ["client_id", "client_secret", "refresh_token", "token_uri"] + missing = [k for k in required_keys if k not in token_data] + if missing: + print(f"ERROR: google_token.json is missing required fields: {', '.join(missing)}", file=sys.stderr) + print("Please re-authenticate by running the Google Workspace setup script.", file=sys.stderr) + sys.exit(1) + params = urllib.parse.urlencode({ "client_id": token_data["client_id"], "client_secret": token_data["client_secret"],