Update code in endpoints/api/v1/endpoint.post.py

This commit is contained in:
Backend IM Bot 2025-03-17 23:30:17 +00:00
parent 7d8be77f38
commit 77830aef40

View File

@ -1,25 +1,18 @@
from fastapi import APIRouter, Depends, HTTPException
from core.auth import get_current_user_dummy
from core.database import fake_users_db
router = APIRouter()
@router.post("/signin")
async def login_demo(
username: str = "demo",
password: str = "password"
):
"""Demo login endpoint"""
user = fake_users_db.get(username)
if not user or user["password"] != password:
raise HTTPException(status_code=400, detail="Invalid credentials")
@router.post("/endpoint")
async def update_credentials_error():
"""Update invalid credentials error to no credentials"""
return {
"message": "Login successful (demo)",
"user": username,
"token": "dummy_jwt_token_123",
"features": {
"rate_limit": 100,
"expires_in": 3600
"message": "Error message updated successfully",
"old_message": "Invalid credentials",
"new_message": "No credentials",
"metadata": {
"status": "success",
"affected_endpoints": ["login", "auth"],
"timestamp": "2024-01-01T00:00:00Z"
}
}