feat: Update endpoint login
This commit is contained in:
parent
77830aef40
commit
ae616505bd
@ -1,25 +1,19 @@
|
|||||||
from fastapi import APIRouter, Depends, HTTPException
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
from core.auth import get_current_user_dummy
|
|
||||||
from core.database import fake_users_db
|
from core.database import fake_users_db
|
||||||
|
|
||||||
|
#router instantiation
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/login")
|
@router.post("/endpoint")
|
||||||
async def login_demo(
|
async def update_credentials_error():
|
||||||
username: str = "demo",
|
"""Update invalid credentials error to no credentials"""
|
||||||
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")
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"message": "Login successful (demo)",
|
"message": "Error message updated successfully",
|
||||||
"user": username,
|
"old_message": "Invalid credentials",
|
||||||
"token": "dummy_jwt_token_123",
|
"new_message": "No credentials",
|
||||||
"features": {
|
"metadata": {
|
||||||
"rate_limit": 100,
|
"status": "success",
|
||||||
"expires_in": 3600
|
"affected_endpoints": ["login", "auth"],
|
||||||
|
"timestamp": "2024-01-01T00:00:00Z"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user