[30388f42] Infrastructure Hardening: Repaired CE/Connector DB schema, fixed frontend styling build, implemented robust echo shield in worker v2.1.1, and integrated Lead Engine into gateway.

This commit is contained in:
2026-03-07 14:08:42 +00:00
parent efcaa57cf0
commit ae2303b733
404 changed files with 24100 additions and 13301 deletions

View File

@@ -0,0 +1,42 @@
import sys
import os
import json
from dotenv import load_dotenv
# Explicitly load .env from the project root
dotenv_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '.env'))
load_dotenv(dotenv_path=dotenv_path, override=True)
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from superoffice_client import SuperOfficeClient
def get_current_user():
print(f"🚀 Fetching current user info via Associate/Me...")
try:
client = SuperOfficeClient()
if not client.access_token:
print("❌ Authentication failed.")
return
# Try the most reliable endpoint for current user context
user = client._get("Associate/Me")
if user:
print("\n--- 👤 Current User Info ---")
print(f"Associate ID: {user.get('AssociateId')}")
print(f"Name: {user.get('FullName')}")
print(f"UserName: {user.get('UserName')}")
print("----------------------------")
return user.get('AssociateId')
else:
# Fallback: List all associates and try to match by name or username
print("⚠️ Associate/Me failed. Trying alternative...")
# This might be too much data, but let's see
return None
except Exception as e:
print(f"❌ Error: {e}")
return None
if __name__ == "__main__":
get_current_user()