mirror of
https://github.com/aljazceru/enclava.git
synced 2025-12-17 07:24:34 +01:00
debug
This commit is contained in:
@@ -162,6 +162,9 @@ async def login(
|
|||||||
):
|
):
|
||||||
"""Login user and return access tokens"""
|
"""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 DEBUG ===")
|
||||||
logger.info(f"Login attempt for email: {user_data.email}")
|
logger.info(f"Login attempt for email: {user_data.email}")
|
||||||
logger.info(f"Current UTC time: {datetime.utcnow().isoformat()}")
|
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 - ADMIN_EMAIL: {settings.ADMIN_EMAIL}")
|
||||||
logger.info(f"Settings check - BCRYPT_ROUNDS: {settings.BCRYPT_ROUNDS}")
|
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
|
# DEBUG: Check database connection with timeout
|
||||||
try:
|
try:
|
||||||
logger.info("Testing database connection...")
|
logger.info("Testing database connection...")
|
||||||
|
|||||||
@@ -74,6 +74,13 @@ class DebuggingMiddleware(BaseHTTPMiddleware):
|
|||||||
# Add timeout detection
|
# Add timeout detection
|
||||||
try:
|
try:
|
||||||
logger.info(f"=== START PROCESSING REQUEST === {request_id} at {datetime.utcnow().isoformat()}")
|
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)
|
response = await call_next(request)
|
||||||
logger.info(f"=== REQUEST COMPLETED === {request_id} at {datetime.utcnow().isoformat()}")
|
logger.info(f"=== REQUEST COMPLETED === {request_id} at {datetime.utcnow().isoformat()}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user