fix(supabase): use internal URL for all server-side clients with cookie name matching
ROOT CAUSE FIX: All server-side Supabase clients (server-client, middleware-client, server-admin-client) now use SUPABASE_INTERNAL_URL (http://supabase-kong:8000) when available, with cookieOptions.name set to match the external URL's cookie key (e.g. sb-myeasycms-auth-token). This gives us: - Reliable Docker-internal networking (no hairpin NAT through Traefik) - Correct session cookie matching between browser and server - No more 500 errors on SSR pages that query Supabase Reverted per-page try/catch workarounds since root cause is now fixed.
This commit is contained in:
@@ -321,10 +321,12 @@ services:
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
NEXT_PUBLIC_SITE_URL: ${SITE_URL:-http://localhost:3000}
|
||||
# Same URL for browser AND server — keeps Supabase cookie names consistent
|
||||
# Same URL for browser AND server cookie names
|
||||
NEXT_PUBLIC_SUPABASE_URL: ${API_EXTERNAL_URL:-http://localhost:8000}
|
||||
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY: ${SUPABASE_ANON_KEY}
|
||||
NEXT_PUBLIC_DEFAULT_LOCALE: de
|
||||
# Internal URL for server-side Supabase calls (Docker network, no hairpin NAT)
|
||||
SUPABASE_INTERNAL_URL: http://supabase-kong:8000
|
||||
SUPABASE_SECRET_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
|
||||
SUPABASE_DB_WEBHOOK_SECRET: ${DB_WEBHOOK_SECRET:-webhooksecret}
|
||||
EMAIL_SENDER: ${EMAIL_SENDER:-noreply@myeasycms.de}
|
||||
|
||||
Reference in New Issue
Block a user