From bb92ed2731d7de53f2e55e5233ae1fcc93bc52e3 Mon Sep 17 00:00:00 2001 From: JesseMarkowitz Date: Sat, 28 Feb 2026 05:24:18 -0500 Subject: [PATCH] fix: update debug_auth.py to check accessToken presence by key Co-Authored-By: Claude Sonnet 4.6 --- debug_auth.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/debug_auth.py b/debug_auth.py index 2c1fa7b..1a8374c 100644 --- a/debug_auth.py +++ b/debug_auth.py @@ -23,4 +23,15 @@ print("Calling /api/auth/session (with Chrome TLS impersonation) ...") r = s.get("https://chatgpt.com/api/auth/session", timeout=15) print(f"Status: {r.status_code}") print(f"Content-Type: {r.headers.get('content-type', '(none)')}") -print(f"Response body (first 500 chars):\n{r.text[:500]}") + +try: + data = r.json() + print(f"Top-level keys: {list(data.keys())}") + access_token = data.get("accessToken") + if access_token: + print(f"accessToken: FOUND (length={len(access_token)}, starts with '{access_token[:10]}...')") + else: + print("accessToken: NOT FOUND in response") + print(f"Full response body:\n{r.text}") +except Exception as e: + print(f"Could not parse JSON: {e}\nRaw body:\n{r.text[:500]}")