Skip to content

Commit fb4320c

Browse files
committed
Fix Hardcoded Supabase Service Key Bypass
1 parent da8faf2 commit fb4320c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

backend/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Supabase Configuration
22
SUPABASE_URL=https://your-project.supabase.co
3-
SUPABASE_SERVICE_KEY=your-service-key
3+
SUPABASE_ANON_KEY=your-anon-key
44

55
# Startup Mode
66
# Set ALLOW_DEGRADED_STARTUP=1 to allow backend startup even if duplicate/RAG models fail to load

backend/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
env_path = Path(__file__).parent / '.env'
3636
load_dotenv(dotenv_path=env_path)
3737

38-
# Initialize Supabase Client (Service Role for backend bypass)
38+
# Initialize Supabase Client (Anon Key to respect RLS)
3939
try:
4040
from supabase import create_client, Client
4141
url = os.environ.get("SUPABASE_URL")
42-
key = os.environ.get("SUPABASE_SERVICE_KEY")
42+
key = os.environ.get("SUPABASE_ANON_KEY")
4343
if not url or not key:
44-
print("[ERROR] SUPABASE_URL or SUPABASE_SERVICE_KEY not set in backend/.env")
44+
print("[ERROR] SUPABASE_URL or SUPABASE_ANON_KEY not set in backend/.env")
4545
supabase = None
4646
else:
4747
supabase = create_client(url, key)

0 commit comments

Comments
 (0)