Sign in user on server based on user_id to bypass RLS #19920
-
Beta Was this translation helpful? Give feedback.
Answered by
GaryAustin1
Dec 20, 2023
Replies: 1 comment 1 reply
-
|
You probably will need to just mint a jwt with any jwt library using the Supabase jwt secret. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pczern
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

You probably will need to just mint a jwt with any jwt library using the Supabase jwt secret.
There are a few required claims: https://supabase.com/docs/learn/auth-deep-dive/auth-deep-dive-jwts#jwts-in-supabase
Then you use the minted jwt in the Authorization header as 'bearer jwt' which is a createClient option.
This works fine for general API stuff but it doesn't play with normal auth sessions and clients like auth-helpers/ssr.