From 4722da9642dff3b185e4f180e1c891199e06f512 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 14 Feb 2024 15:51:42 +0530 Subject: [PATCH] Only enable API token, Whatsapp cards on Web UI when Stripe, Twilio setup --- src/khoj/interface/web/config.html | 6 ++++++ src/khoj/routers/web_client.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/khoj/interface/web/config.html b/src/khoj/interface/web/config.html index 54a4de41..385baf06 100644 --- a/src/khoj/interface/web/config.html +++ b/src/khoj/interface/web/config.html @@ -187,8 +187,10 @@ + {% if not anonymous_mode or is_twilio_enabled %}

Clients

+ {% if not anonymous_mode %}
API Key @@ -213,6 +215,8 @@
+ {% endif %} + {% if is_twilio_enabled %}
WhatsApp icon @@ -244,7 +248,9 @@
+ {% endif %}
+ {% endif %} {% if billing_enabled %}

Billing

diff --git a/src/khoj/routers/web_client.py b/src/khoj/routers/web_client.py index 529adbd0..7388084c 100644 --- a/src/khoj/routers/web_client.py +++ b/src/khoj/routers/web_client.py @@ -180,8 +180,8 @@ def config_page(request: Request): "khoj_cloud_subscription_url": os.getenv("KHOJ_CLOUD_SUBSCRIPTION_URL"), "is_active": has_required_scope(request, ["premium"]), "has_documents": has_documents, - "phone_number": user.phone_number, "is_twilio_enabled": is_twilio_enabled(), + "phone_number": user.phone_number, "is_phone_number_verified": user.verified_phone_number, }, )