From e471912efccb5151716c9cd4c8d9f641bb6c68c9 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 25 Mar 2025 16:40:01 +0000 Subject: [PATCH] Update code in endpoints/login.post.py --- endpoints/login.post.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/endpoints/login.post.py b/endpoints/login.post.py index 1724af7..ef3a1ac 100644 --- a/endpoints/login.post.py +++ b/endpoints/login.post.py @@ -1,23 +1,23 @@ -from fastapi import APIRouter, Depends, HTTPException +from fastapi import APIRouter, HTTPException users = [] # In-memory storage router = APIRouter() @router.post("/login") -async def login_demo( +async def login( username: str = "demo", password: str = "password" ): - """Demo login endpoint""" + """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 (demo)", + "message": "Login successful", "user": username, - "token": "dummy_jwt_token_123", + "token": "dummy_jwt_token_123", "features": { "rate_limit": 100, "expires_in": 3600