mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-12-22 12:18:09 +00:00
If not in debug mode, force google auth to use the https protocol
This commit is contained in:
parent
bcc1bc6854
commit
f291884921
3 changed files with 5 additions and 2 deletions
|
@ -27,7 +27,6 @@ from khoj.processor.conversation.utils import (
|
||||||
from khoj.utils import state
|
from khoj.utils import state
|
||||||
from khoj.utils.helpers import (
|
from khoj.utils.helpers import (
|
||||||
get_chat_usage_metrics,
|
get_chat_usage_metrics,
|
||||||
in_debug_mode,
|
|
||||||
is_none_or_empty,
|
is_none_or_empty,
|
||||||
is_promptrace_enabled,
|
is_promptrace_enabled,
|
||||||
)
|
)
|
||||||
|
|
|
@ -23,7 +23,6 @@ from khoj.utils import state
|
||||||
from khoj.utils.constants import empty_escape_sequences
|
from khoj.utils.constants import empty_escape_sequences
|
||||||
from khoj.utils.helpers import (
|
from khoj.utils.helpers import (
|
||||||
ConversationCommand,
|
ConversationCommand,
|
||||||
in_debug_mode,
|
|
||||||
is_none_or_empty,
|
is_none_or_empty,
|
||||||
is_promptrace_enabled,
|
is_promptrace_enabled,
|
||||||
truncate_code_context,
|
truncate_code_context,
|
||||||
|
|
|
@ -28,6 +28,7 @@ from khoj.routers.helpers import (
|
||||||
update_telemetry_state,
|
update_telemetry_state,
|
||||||
)
|
)
|
||||||
from khoj.utils import state
|
from khoj.utils import state
|
||||||
|
from khoj.utils.helpers import in_debug_mode
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -214,6 +215,10 @@ async def auth(request: Request):
|
||||||
|
|
||||||
# 1. Construct the full redirect URI including domain
|
# 1. Construct the full redirect URI including domain
|
||||||
base_url = str(request.base_url).rstrip("/")
|
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')}"
|
redirect_uri = f"{base_url}{request.app.url_path_for('auth')}"
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
|
|
Loading…
Reference in a new issue