diff --git a/backend/app/services/auto_login_service.py b/backend/app/services/auto_login_service.py index 8d1c773..11957d8 100644 --- a/backend/app/services/auto_login_service.py +++ b/backend/app/services/auto_login_service.py @@ -198,7 +198,10 @@ def _perform_zerodha_login( request_id = login_data["data"]["request_id"] # Step 2: TOTP — don't follow redirect automatically - import pyotp # imported here so missing package doesn't crash startup + try: + import pyotp + except ImportError: + raise AutoLoginError("pyotp is not installed on the server. Run: pip install pyotp==2.9.0") totp_value = pyotp.TOTP(totp_secret).now() twofa_resp = session.post( KITE_TWOFA_ENDPOINT,