Different Supabase URL for client side and server side breaks auth
I'm having serious problems trying to run supabase self hosted in docker compose. supabase itself works great but the server side code sets an auth cookie with the wrong name, since its supabase hostname is obviously a service, whereas for client side (testing in Chrome) it is obviously localhost.
@supabase/ssr
automatically sets a client side cookie called sb-localhost-auth-token
but is tying to read a cookie called sb-kong-auth-token
on the server side. Is this truly not supported, ie do I need to patch the official auth client to use supabase in docker with client side testing?1 Reply
I found a workaround that might work for other people: setting the client side supabase URL to
kong.localhost
, it seems that @supabase/ssr
only takes the subdomain portion for the cookie name, so this actually results in a cookie called sb-kong-auth-token
which the server side supabase client can read