From a1b19b7431f76039a2463975e0d555012ae70b87 Mon Sep 17 00:00:00 2001 From: Thigazhezhilan J Date: Mon, 25 May 2026 21:30:03 +0530 Subject: [PATCH] Add debug logging to auto-login twofa step Prints twofa response status, Location header, and body so we can see exactly what Zerodha returns after TOTP submission. Co-Authored-By: Claude Sonnet 4.6 --- backend/app/services/auto_login_service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/app/services/auto_login_service.py b/backend/app/services/auto_login_service.py index 88cb793..81f1382 100644 --- a/backend/app/services/auto_login_service.py +++ b/backend/app/services/auto_login_service.py @@ -221,6 +221,12 @@ def _perform_zerodha_login( timeout=15, allow_redirects=False, ) + print( + f"[AUTO-LOGIN-DEBUG] twofa status={twofa_resp.status_code} " + f"location={twofa_resp.headers.get('Location', 'NONE')} " + f"body={twofa_resp.text[:300]}", + flush=True, + ) # Step 4: Follow redirects manually to intercept request_token request_token = None