Log verification

After deploy or 6:00 AM, check PM2 logs:

Expected success path

  1. Removed Zerodha token at 6:00 AM (Kite daily expiry).
  2. Zerodha auto-login successful at 6:00 AM
  3. Market data streaming ensured
After PM2 restart, expect either preserved streaming or Startup auto-login succeeded.

Fallback

If auto-login fails, use the existing manual flow:
  • UI: Login to Zerodha button in the header
  • API: GET /api/zerodha/login
Check server logs for Zerodha auto-login failed at 6:00 AM or Startup auto-login failed messages.

Manual test script

This runs auto-login once and restarts streaming immediately on success. Check logs for Market data streaming ensured and no repeating Error in startFinacialInterval: Incorrect api_key or access_token.

Manual test endpoint

Admin-only endpoint for testing without waiting for cron:
Success response:
Verify connection:

Security notes

  • Store credentials only in environment variables or a secrets manager
  • Never log password or TOTP secret values
  • Auto-login uses unofficial Kite web login endpoints; keep manual login as fallback