From fb4320ce25dd94a74e0f9e4d28bd3ce9ccc41bab Mon Sep 17 00:00:00 2001 From: Arsh Verma Date: Sun, 7 Jun 2026 04:14:12 +0530 Subject: [PATCH] Fix Hardcoded Supabase Service Key Bypass --- backend/.env.example | 2 +- backend/main.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/.env.example b/backend/.env.example index f7247e992..cc0020144 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,6 +1,6 @@ # Supabase Configuration SUPABASE_URL=https://your-project.supabase.co -SUPABASE_SERVICE_KEY=your-service-key +SUPABASE_ANON_KEY=your-anon-key # Startup Mode # Set ALLOW_DEGRADED_STARTUP=1 to allow backend startup even if duplicate/RAG models fail to load diff --git a/backend/main.py b/backend/main.py index ae7da7c1f..4200883d0 100644 --- a/backend/main.py +++ b/backend/main.py @@ -35,13 +35,13 @@ env_path = Path(__file__).parent / '.env' load_dotenv(dotenv_path=env_path) -# Initialize Supabase Client (Service Role for backend bypass) +# Initialize Supabase Client (Anon Key to respect RLS) try: from supabase import create_client, Client url = os.environ.get("SUPABASE_URL") - key = os.environ.get("SUPABASE_SERVICE_KEY") + key = os.environ.get("SUPABASE_ANON_KEY") if not url or not key: - print("[ERROR] SUPABASE_URL or SUPABASE_SERVICE_KEY not set in backend/.env") + print("[ERROR] SUPABASE_URL or SUPABASE_ANON_KEY not set in backend/.env") supabase = None else: supabase = create_client(url, key)