fix: Resolve IPv4/IPv6 connection issues in News Engine Console
- Backend: Downgrade Pydantic from v2 to v1.10.13 for compatibility - Backend: Fix ObjectId to string conversion in user service - Backend: Update config to use pydantic BaseSettings (v1 import) - Frontend: Downgrade ESLint packages for compatibility - Frontend: Configure Vite proxy to use 127.0.0.1 instead of localhost - Frontend: Set API client to use direct backend URL (127.0.0.1:8101) - Frontend: Add package-lock.json for dependency locking This resolves MongoDB connection issues and frontend-backend communication problems caused by localhost resolving to IPv6. Verified: Login and dashboard functionality working correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
from pydantic_settings import BaseSettings
|
||||
from pydantic import BaseSettings
|
||||
from typing import List
|
||||
|
||||
class Settings(BaseSettings):
|
||||
|
||||
@ -77,6 +77,7 @@ class UserService:
|
||||
"""Get a user by email"""
|
||||
doc = await self.collection.find_one({"email": email})
|
||||
if doc:
|
||||
doc["_id"] = str(doc["_id"]) # Convert ObjectId to string
|
||||
return User(**doc)
|
||||
return None
|
||||
|
||||
@ -118,7 +119,7 @@ class UserService:
|
||||
}
|
||||
|
||||
result = await self.collection.insert_one(user_dict)
|
||||
user_dict["_id"] = result.inserted_id
|
||||
user_dict["_id"] = str(result.inserted_id) # Convert ObjectId to string
|
||||
|
||||
return User(**user_dict)
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
fastapi==0.104.1
|
||||
uvicorn[standard]==0.24.0
|
||||
motor==3.3.2
|
||||
pydantic==2.5.0
|
||||
pydantic-settings==2.1.0
|
||||
pydantic==1.10.13
|
||||
pydantic[email]==1.10.13
|
||||
python-jose[cryptography]==3.3.0
|
||||
passlib[bcrypt]==1.7.4
|
||||
python-multipart==0.0.6
|
||||
|
||||
Reference in New Issue
Block a user