fix: make auth endpoint work with user API keys (#1385)

This commit is contained in:
Charles Packer
2024-05-14 23:10:26 -07:00
committed by GitHub
parent bd81bd3ed7
commit 6889f63e2c

View File

@@ -28,8 +28,10 @@ def setup_auth_router(server: SyncServer, interface: QueuingInterface, password:
interface.clear()
try:
if request.password != password:
raise HTTPException(status_code=400, detail="Incorrect credentials")
response = server.authenticate_user()
# raise HTTPException(status_code=400, detail="Incorrect credentials")
response = server.api_key_to_user(api_key=request.password)
else:
response = server.authenticate_user()
except HTTPException:
raise
except Exception as e: