FastAPI - Internal Server Error

I've also had similar trouble with FastAPI over in Using OpenZiti in distributed surveillance system.

The function at /login might be provided with the underlying ASGI interface tuple when zitified, maybe because openziti changes something in a way that FastAPI no longer extracts the recieve (Request) part directly, without the function explicitly defining it as parameter?
That's just my guess, but adding request: Request as a parameter for functions worked for me.

Could you try adding request as a parameter to your URL-path(?) functions?
i.e. something like

@app.post("/api/login")
async def login(request: Request, auth_details: AuthDetailsLogin, response: Response):

Disclaimer: I haven't run your code on my machine.