Update code in endpoints/login.post.py

This commit is contained in:
Backend IM Bot 2025-03-22 18:51:45 +00:00
parent b8837ac871
commit 4310d93996

View File

@ -5,17 +5,17 @@ users = [] # In-memory storage
router = APIRouter()
@router.post("/login")
async def login(
async def login_demo(
username: str = "demo",
password: str = "password"
):
"""Login endpoint"""
"""Demo login endpoint"""
user = next((u for u in users if u["username"] == username), None)
if not user or user["password"] != password:
raise HTTPException(status_code=400, detail="Invalid credentials")
return {
"message": "Login successful",
"message": "Login successful (demo)",
"user": username,
"token": "dummy_jwt_token_123",
"features": {