From 20df0f53306d5009214cf1b55d95e747a6133892 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Thu, 2 Nov 2023 14:55:14 -0700 Subject: [PATCH] Use url_path_for for creating the login page URL in the application --- src/khoj/routers/web_client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/khoj/routers/web_client.py b/src/khoj/routers/web_client.py index 8f5262cc..8014c62d 100644 --- a/src/khoj/routers/web_client.py +++ b/src/khoj/routers/web_client.py @@ -21,7 +21,6 @@ from khoj.utils import constants, state from database.adapters import EntryAdapters, get_user_github_config, get_user_notion_config, ConversationAdapters from database.models import LocalOrgConfig, LocalMarkdownConfig, LocalPdfConfig, LocalPlaintextConfig - # Initialize Router web_client = APIRouter() templates = Jinja2Templates(directory=constants.web_directory) @@ -87,7 +86,7 @@ def login_page(request: Request): next_url = request.query_params.get("next", "/") return RedirectResponse(url=next_url) google_client_id = os.environ.get("GOOGLE_CLIENT_ID") - redirect_uri = request.url_for("auth") + redirect_uri = str(request.app.url_path_for("auth")) return templates.TemplateResponse( "login.html", context={