From f435d74d0a5bfbc0522789a28e2de2ca84d41e4a Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 30 Sep 2025 19:36:44 +0530 Subject: [PATCH] refactor: access token is now a password field --- .../doctype/lead_sync_source/lead_sync_source.json | 7 ++++--- .../doctype/lead_sync_source/lead_sync_source.py | 4 ++-- .../Settings/LeadSyncing/leadSyncSourceConfig.js | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/crm/lead_syncing/doctype/lead_sync_source/lead_sync_source.json b/crm/lead_syncing/doctype/lead_sync_source/lead_sync_source.json index 5464d199..bf9d4fff 100644 --- a/crm/lead_syncing/doctype/lead_sync_source/lead_sync_source.json +++ b/crm/lead_syncing/doctype/lead_sync_source/lead_sync_source.json @@ -36,8 +36,9 @@ }, { "fieldname": "access_token", - "fieldtype": "Small Text", - "label": "Access Token" + "fieldtype": "Password", + "label": "Access Token", + "length": 500 }, { "depends_on": "eval:doc.type===\"Facebook\"", @@ -72,7 +73,7 @@ "grid_page_length": 50, "index_web_pages_for_search": 1, "links": [], - "modified": "2025-09-29 19:54:24.841414", + "modified": "2025-09-30 19:31:57.730618", "modified_by": "Administrator", "module": "Lead Syncing", "name": "Lead Sync Source", diff --git a/crm/lead_syncing/doctype/lead_sync_source/lead_sync_source.py b/crm/lead_syncing/doctype/lead_sync_source/lead_sync_source.py index 7afe756f..eb854c88 100644 --- a/crm/lead_syncing/doctype/lead_sync_source/lead_sync_source.py +++ b/crm/lead_syncing/doctype/lead_sync_source/lead_sync_source.py @@ -25,7 +25,7 @@ class LeadSyncSource(Document): if TYPE_CHECKING: from frappe.types import DF - access_token: DF.SmallText | None + access_token: DF.Password | None enabled: DF.Check facebook_lead_form: DF.Link | None facebook_page: DF.Link | None @@ -42,7 +42,7 @@ class LeadSyncSource(Document): @frappe.whitelist() def sync_leads(self): if self.type == "Facebook" and self.access_token: - sync_leads_from_facebook(self.access_token, self.facebook_lead_form) + sync_leads_from_facebook(self.get_password("access_token"), self.facebook_lead_form) def sync_leads_from_facebook(access_token: str, lead_form_id: str) -> None: diff --git a/frontend/src/components/Settings/LeadSyncing/leadSyncSourceConfig.js b/frontend/src/components/Settings/LeadSyncing/leadSyncSourceConfig.js index a089dfca..22c7282e 100644 --- a/frontend/src/components/Settings/LeadSyncing/leadSyncSourceConfig.js +++ b/frontend/src/components/Settings/LeadSyncing/leadSyncSourceConfig.js @@ -5,7 +5,7 @@ export const supportedSourceTypes = [ { name: 'Facebook', icon: LogoFacebook, - link: 'https://support.google.com/accounts/answer/185833', + link: 'https://www.facebook.com/business/help/503306463479099?id=2190812977867143', custom: false, } ] \ No newline at end of file