fix: market auth error handling, identity field forwarding

This commit is contained in:
2026-07-26 21:16:16 +08:00
parent 5735602f7d
commit f4a0869af5
+4 -3
View File
@@ -512,11 +512,12 @@ async def api_market_auth(data: dict):
async with httpx.AsyncClient(timeout=10) as client:
resp = await client.post(
f"{url}/api/collections/users/auth-with-password",
json={"identity": data.get("email"), "password": data.get("password")}
json={"identity": data.get("email", data.get("identity","")), "password": data.get("password")}
)
return resp.json()
result = resp.json()
return result
except Exception as e:
return {"error": str(e)}
return {"message": "服务器连接失败: " + str(e), "token": None}
@router.post("/market/register")