diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 61103e079cb..6b5502b3c28 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2858,8 +2858,11 @@ async def user_auth(request: Request): @app.get("/google-login", tags=["experimental"]) -async def google_login(): - GOOGLE_REDIRECT_URI = "http://localhost:4000/google-callback" +async def google_login(request: Request): + scheme = request.url.scheme + host = request.url.hostname + port = request.url.port or 4000 + GOOGLE_REDIRECT_URI = f"{scheme}://{host}:{port}/google-callback" GOOGLE_CLIENT_ID = ( "246483686424-clje5sggkjma26ilktj6qssakqhoon0m.apps.googleusercontent.com" ) @@ -2868,10 +2871,14 @@ async def google_login(): @app.get("/google-callback", tags=["experimental"], response_model=GenerateKeyResponse) -async def google_callback(code: str): +async def google_callback(code: str, request: Request): import httpx - GOOGLE_REDIRECT_URI = "http://localhost:4000/google-callback" + scheme = request.url.scheme + host = request.url.hostname + port = request.url.port or 4000 + + GOOGLE_REDIRECT_URI = f"{scheme}://{host}:{port}/google-callback" GOOGLE_CLIENT_ID = ( "246483686424-clje5sggkjma26ilktj6qssakqhoon0m.apps.googleusercontent.com" ) diff --git a/pyproject.toml b/pyproject.toml index 744263c69aa..d46b85ea234 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "1.20.0" +version = "1.20.1" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT" @@ -63,7 +63,7 @@ requires = ["poetry-core", "wheel"] build-backend = "poetry.core.masonry.api" [tool.commitizen] -version = "1.20.0" +version = "1.20.1" version_files = [ "pyproject.toml:^version" ]