diff --git a/backend/app/api/v1/auth.py b/backend/app/api/v1/auth.py index 5e3bbb5..a2f806b 100644 --- a/backend/app/api/v1/auth.py +++ b/backend/app/api/v1/auth.py @@ -162,6 +162,9 @@ async def login( ): """Login user and return access tokens""" + logger.info(f"==================================================") + logger.info(f"=== LOGIN ENDPOINT REACHED ===") + logger.info(f"==================================================") logger.info(f"=== LOGIN DEBUG ===") logger.info(f"Login attempt for email: {user_data.email}") logger.info(f"Current UTC time: {datetime.utcnow().isoformat()}") @@ -170,6 +173,21 @@ async def login( logger.info(f"Settings check - ADMIN_EMAIL: {settings.ADMIN_EMAIL}") logger.info(f"Settings check - BCRYPT_ROUNDS: {settings.BCRYPT_ROUNDS}") + # DEBUG: Check Redis connection + try: + logger.info("Testing Redis connection...") + import redis.asyncio as redis + redis_url = settings.REDIS_URL + logger.info(f"Redis URL: {redis_url}") + redis_client = redis.from_url(redis_url) + test_start = datetime.utcnow() + await redis_client.ping() + test_end = datetime.utcnow() + logger.info(f"Redis connection test successful. Time: {(test_end - test_start).total_seconds()} seconds") + await redis_client.close() + except Exception as e: + logger.error(f"Redis connection test failed: {e}") + # DEBUG: Check database connection with timeout try: logger.info("Testing database connection...") diff --git a/backend/app/middleware/debugging.py b/backend/app/middleware/debugging.py index ca2dd29..6a29a41 100644 --- a/backend/app/middleware/debugging.py +++ b/backend/app/middleware/debugging.py @@ -74,6 +74,13 @@ class DebuggingMiddleware(BaseHTTPMiddleware): # Add timeout detection try: logger.info(f"=== START PROCESSING REQUEST === {request_id} at {datetime.utcnow().isoformat()}") + logger.info(f"Request path: {request.url.path}") + logger.info(f"Request method: {request.method}") + + # Check if this is the login endpoint + if request.url.path == "/api-internal/v1/auth/login" and request.method == "POST": + logger.info(f"=== LOGIN REQUEST DETECTED === {request_id}") + response = await call_next(request) logger.info(f"=== REQUEST COMPLETED === {request_id} at {datetime.utcnow().isoformat()}")