gradific_-vdv2b5/endpoints/login.post.py
2025-03-22 13:00:35 +00:00

25 lines
667 B
Python

from fastapi import APIRouter, HTTPException
products = [] # In-memory storage
router = APIRouter()
@router.post("/login")
async def product_login(
username: str = "merchant",
password: str = "store123"
):
"""Product login endpoint"""
user = next((u for u in products if u["username"] == username), None)
if not user or user["password"] != password:
raise HTTPException(status_code=400, detail="Invalid credentials")
return {
"message": "Login successful",
"user": username,
"token": "dummy_jwt_token_123",
"features": {
"rate_limit": 100,
"expires_in": 3600
}
}