update login endpoint

This commit is contained in:
ben
2026-08-03 12:31:13 +02:00
parent 42b2177a13
commit 28b1697052
+14
View File
@@ -98,3 +98,17 @@ def api_create_user(user: UserCreate):
@app.post("/login") @app.post("/login")
def api_login(login: Login): def api_login(login: Login):
user_id = verify_user(
login.username,
login.password
)
if user_id is None:
return {
"status": "failed"
}
return {
"status": "success",
"user_id": user_id
}