From 7861b6e21b320a4f349a289f5eba383e56be4f37 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Sat, 27 Jan 2024 16:38:56 -0800 Subject: [PATCH] (fix) proxy use env as GOOGLE_REDIRECT_URI --- litellm/proxy/proxy_server.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index d0711f595..9814711dc 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -2855,12 +2855,7 @@ async def user_auth(request: Request): @app.get("/google-login", tags=["experimental"]) async def google_login(request: Request): - scheme = request.url.scheme or "https" - host = request.url.hostname or "localhost" - port = request.url.port or 4000 - if "localhost" not in host: - scheme = "https" - GOOGLE_REDIRECT_URI = f"{scheme}://{host}:{port}/google-callback" + GOOGLE_REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI") GOOGLE_CLIENT_ID = ( "246483686424-clje5sggkjma26ilktj6qssakqhoon0m.apps.googleusercontent.com" ) @@ -2872,13 +2867,7 @@ async def google_login(request: Request): async def google_callback(code: str, request: Request): import httpx - scheme = request.url.scheme or "https" - host = request.url.hostname or "localhost" - port = request.url.port or 4000 - if "localhost" not in host: - scheme = "https" - - GOOGLE_REDIRECT_URI = f"{scheme}://{host}:{port}/google-callback" + GOOGLE_REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI") GOOGLE_CLIENT_ID = ( "246483686424-clje5sggkjma26ilktj6qssakqhoon0m.apps.googleusercontent.com" )