Remove hardcoded Zoho credentials - now users input credentials through frontend

This commit is contained in:
Iyeoluwa Akinrinola
2025-07-25 11:58:57 +01:00
parent 6dc5773943
commit 75c447fe03
4 changed files with 44 additions and 8 deletions
+8 -4
View File
@@ -9,12 +9,16 @@ from dotenv import load_dotenv
load_dotenv()
class ZohoClient:
def __init__(self):
def __init__(self, email=None, app_password=None):
self.imap_server = "imap.zoho.com"
self.imap_port = 993
self.email = os.getenv("ZOHO_EMAIL", "projects@manaknightdigital.com")
# Use app password instead of regular password
self.app_password = os.getenv("ZOHO_APP_PASSWORD", "s7t8t9j6ebjm")
# Use provided credentials or fall back to environment variables
self.email = email or os.getenv("ZOHO_EMAIL", "")
self.app_password = app_password or os.getenv("ZOHO_APP_PASSWORD", "")
if not self.email or not self.app_password:
raise ValueError("Zoho email and app password must be provided")
self.connection = None
self._connect()