diff --git a/backend/main.py b/backend/main.py index 1e2735a..e30919f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -113,7 +113,8 @@ def search_guests( # Google OAuth configuration GOOGLE_CLIENT_ID = os.getenv("GOOGLE_CLIENT_ID") GOOGLE_CLIENT_SECRET = os.getenv("GOOGLE_CLIENT_SECRET") -GOOGLE_REDIRECT_URI = "http://localhost:8000/auth/google/callback" +GOOGLE_REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI", "http://localhost:8000/auth/google/callback") +FRONTEND_URL = os.getenv("FRONTEND_URL", "http://localhost:5173") # Google OAuth endpoints @app.get("/auth/google") @@ -179,13 +180,13 @@ async def google_callback(code: str, db: Session = Depends(get_db)): # Redirect back to frontend with success message return RedirectResponse( - url=f"http://localhost:5173?imported={imported_count}&owner={owner}", + url=f"{FRONTEND_URL}?imported={imported_count}&owner={owner}", status_code=302 ) except Exception as e: # Redirect back with error return RedirectResponse( - url=f"http://localhost:5173?error={str(e)}", + url=f"{FRONTEND_URL}?error={str(e)}", status_code=302 )