fix: disable session persistence for service role keys#151
fix: disable session persistence for service role keys#1517ttp wants to merge 1 commit intosupabase:mainfrom
Conversation
|
This might be something the maintainers wanna go ahead and do, but if you're using the key that bypasses RLS you'd typically just use the native createClient from supabase-js. |
fair point, but @supabase/ssr is the recommended package for ssr frameworks as per the docs https://supabase.com/docs/guides/auth/server-side |
|
I understand wanting to have an ssr library native way of doing this. Perhaps they can introduce something like
P.S. if you weren't aware, |
|
I agree with @j4w8n on the introduction of a |
when using a service role key with
createServerClient, the client was reading user sessions from cookies and using that token for authorization instead of the service role key. this causedrlsto be applied even though service role keys should bypass it.this fix detects service role keys by checking the
jwtpayload and disablespersistSession, ensuring theservice role keyis used directly for all requests.fixes the 403 unauthorized error on storage operations when using secret keys.
closes #141