If not in debug mode, force google auth to use the https protocol

This commit is contained in:
sabaimran 2024-12-17 15:44:18 -08:00
parent bcc1bc6854
commit f291884921
3 changed files with 5 additions and 2 deletions

View file

@ -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,
)

View file

@ -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,

View file

@ -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 = {