diff --git a/src/khoj/processor/conversation/google/utils.py b/src/khoj/processor/conversation/google/utils.py index 5f24362b..8060ea5e 100644 --- a/src/khoj/processor/conversation/google/utils.py +++ b/src/khoj/processor/conversation/google/utils.py @@ -27,7 +27,6 @@ from khoj.processor.conversation.utils import ( from khoj.utils import state from khoj.utils.helpers import ( get_chat_usage_metrics, - in_debug_mode, is_none_or_empty, is_promptrace_enabled, ) diff --git a/src/khoj/processor/conversation/offline/chat_model.py b/src/khoj/processor/conversation/offline/chat_model.py index 5ce45bac..f727fd1d 100644 --- a/src/khoj/processor/conversation/offline/chat_model.py +++ b/src/khoj/processor/conversation/offline/chat_model.py @@ -23,7 +23,6 @@ from khoj.utils import state from khoj.utils.constants import empty_escape_sequences from khoj.utils.helpers import ( ConversationCommand, - in_debug_mode, is_none_or_empty, is_promptrace_enabled, truncate_code_context, diff --git a/src/khoj/routers/auth.py b/src/khoj/routers/auth.py index 022d4c92..03cb174e 100644 --- a/src/khoj/routers/auth.py +++ b/src/khoj/routers/auth.py @@ -28,6 +28,7 @@ from khoj.routers.helpers import ( update_telemetry_state, ) from khoj.utils import state +from khoj.utils.helpers import in_debug_mode logger = logging.getLogger(__name__) @@ -214,6 +215,10 @@ async def auth(request: Request): # 1. Construct the full redirect URI including domain base_url = str(request.base_url).rstrip("/") + + if not in_debug_mode(): + base_url = base_url.replace("http://", "https://") + redirect_uri = f"{base_url}{request.app.url_path_for('auth')}" payload = {