habulaj commited on
Commit
e4b1653
·
verified ·
1 Parent(s): b90aac6

Update routes/subscription.py

Browse files
Files changed (1) hide show
  1. routes/subscription.py +3 -2
routes/subscription.py CHANGED
@@ -22,6 +22,7 @@ stripe.api_version = "2023-10-16"
22
  # 🔥 Supabase Configuração com Secrets
23
  SUPABASE_URL = "https://ussxqnifefkgkaumjann.supabase.co"
24
  SUPABASE_KEY = os.getenv("SUPA_KEY") # Lendo do ambiente
 
25
 
26
  if not stripe.api_key or not SUPABASE_KEY:
27
  raise ValueError("❌ STRIPE_KEY ou SUPA_KEY não foram definidos no ambiente!")
@@ -365,8 +366,8 @@ async def stripe_webhook(request: Request):
365
  }
366
 
367
  supabase_headers = {
368
- "Authorization": f"Bearer {SUPABASE_KEY}",
369
- "apikey": SUPABASE_KEY,
370
  "Content-Type": "application/json"
371
  }
372
 
 
22
  # 🔥 Supabase Configuração com Secrets
23
  SUPABASE_URL = "https://ussxqnifefkgkaumjann.supabase.co"
24
  SUPABASE_KEY = os.getenv("SUPA_KEY") # Lendo do ambiente
25
+ SUPABASE_ROLE_KEY = os.getenv("SUPA_ROLE_KEY")
26
 
27
  if not stripe.api_key or not SUPABASE_KEY:
28
  raise ValueError("❌ STRIPE_KEY ou SUPA_KEY não foram definidos no ambiente!")
 
366
  }
367
 
368
  supabase_headers = {
369
+ "Authorization": f"Bearer {SUPABASE_ROLE_KEY}", # Usando a chave de serviço
370
+ "apikey": SUPABASE_ROLE_KEY,
371
  "Content-Type": "application/json"
372
  }
373