Multiple Supabase client instances with debug code logging sessions in production
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- next.js, supabase, typescript
- Ambito
- authentication, full-stack, security
Direzione di ricerca
Start by reading src/lib/supabase.ts, src/lib/supabase-admin.ts, src/utils/supabase/server.ts, src/utils/supabase/client.ts, and src/utils/supabase/authActions.ts. Trace which modules import each client and how browser, server, and service-role usage are separated. Done means the debug session logging is gone, the service-role client cannot reach browser code, and the remaining client usage follows one consistent pattern.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue
The project has at least 3 separate Supabase client configurations with inconsistent usage:
src/lib/supabase.ts-createBrowserClient(shared, with debug code)src/lib/supabase-admin.ts-createClientwith service role keysrc/utils/supabase/server.ts-createServerClientsrc/utils/supabase/client.ts- Another browser clientsrc/utils/supabase/authActions.ts- Auth-specific client
Why this matters
-
Debug code left in production -
supabase.ts:16-19:supabase.auth.getSession().then(res => { console.log("📦 [supabase.ts] Initial session:", res); }).catch(err => { console.error("❌ [supabase.ts] Session fetch error:", err); });This runs every time the module is imported - on every page load, logging session data to the console.
-
Potential for service role key leaks - If
supabase-admin.tsis ever imported on the client side (even accidentally), theSUPABASE_SERVICE_ROLE_KEYwould be exposed to the browser, giving full database admin access. -
Inconsistent session handling - Different parts of the app use different client instances, which may have different cookie/session states.
Fix
- Remove the debug
getSession()code fromsupabase.ts - Ensure
supabase-admin.tsis only imported in server-side code (useif (typeof window === 'undefined')guard or move to a server-only directory) - Consolidate to a single client factory pattern
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 26
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenLake/RateMyCourse
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenLake/RateMyCourse#66 ·
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenLake/RateMyCourse#61 ·
-
advanced bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
OpenLake/RateMyCourse#59 ·
-
advanced bug enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
OpenLake/RateMyCourse#58 ·
-
help wanted
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
OpenLake/RateMyCourse#49 · 1 commento ·
Tutte le issue di OpenLake/RateMyCourse
Issue simili
-
Browser Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
getsentry/sentry-javascript#24577 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
agilepathway/label-checker#640 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
copse-dev/agent-pane#2953 ·
-
[aw] Upgrade available Apertaagentic-workflows
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
anomalyco/models.dev#7701 ·