spark-rrrxql/endpoints/login.post.py
2025-03-24 07:06:10 +00:00

23 lines
552 B
Python

from fastapi import APIRouter, HTTPException
users = [] # In-memory storage
router = APIRouter()
@router.post("/login")
async def get_username(
username: str = "demo"
):
"""Get username endpoint"""
user = next((u for u in users if u["username"] == username), None)
if not user:
raise HTTPException(status_code=400, detail="Username not found")
return {
"message": "Username retrieved",
"user": username,
"features": {
"rate_limit": 100,
"expires_in": 3600
}
}