Kellen Mace
03/14/2022, 5:39 AM/api/stripe-webhooks
endpoint, then I make an update to my profiles
table using the data I receive.
Even though I have Realtime turned on for that table and my client-side app has subscribed to receive `UPDATE`s, no Realtime events are received. This is because I have row-level security (RLS) enabled for the profiles
table, and when my /api/stripe-webhooks
endpoint handler function is called, no user is authenticated, so the RLS checks fail.
How can I keep RLS activated to lock down access to my profiles
table, but still receive Realtime updates in my client-side app when the current user's row in the profiles
table gets updated?
More Details:
- I'm using username/password auth.
- The RLS policy on my profiles
table is uid() = id
for all CRUD operations.
- I'm using SvelteKit the supabase-js client the for the client-side app.
Thanks in advance for any help you can give! πNeedle
03/14/2022, 5:39 AM/title
command!
We have solved your problem?
Click the button below to archive it.garyaustin
03/14/2022, 4:07 PMNeedle
03/14/2022, 4:07 PMKellen Mace
03/14/2022, 6:17 PMKellen Mace
03/14/2022, 6:17 PMKellen Mace
03/14/2022, 6:18 PMprofiles
table
3. Supabase Realtime sends the change event to the frontend JS app, and the UI re-rendersKellen Mace
03/14/2022, 6:19 PMprofiles
table, #3 stops happeningKellen Mace
03/14/2022, 6:23 PMUPDATE
event, Supabase checks to see if the user is authenticated and has the permissions necessary. Since no user is logged in, the Realtime update is never sent.garyaustin
03/14/2022, 6:28 PMgaryaustin
03/14/2022, 6:29 PMKellen Mace
03/14/2022, 6:29 PMKellen Mace
03/14/2022, 6:30 PMKellen Mace
03/14/2022, 6:30 PMKellen Mace
03/14/2022, 6:31 PMgaryaustin
03/14/2022, 6:32 PMKellen Mace
03/14/2022, 6:32 PMgaryaustin
03/14/2022, 6:35 PMgaryaustin
03/14/2022, 6:37 PMgaryaustin
03/14/2022, 6:39 PMgaryaustin
03/14/2022, 6:40 PMKellen Mace
03/14/2022, 6:41 PMKellen Mace
03/14/2022, 6:41 PMKellen Mace
03/14/2022, 6:42 PMKellen Mace
03/14/2022, 6:43 PMKellen Mace
03/14/2022, 6:45 PMgaryaustin
03/14/2022, 6:48 PMKellen Mace
03/14/2022, 6:51 PMKellen Mace
03/14/2022, 6:51 PMgaryaustin
03/14/2022, 6:53 PMKellen Mace
03/14/2022, 6:54 PM1.22.6
, so not the latest. I can bump it.Kellen Mace
03/14/2022, 6:55 PMgaryaustin
03/14/2022, 6:58 PMKellen Mace
03/14/2022, 7:24 PMKellen Mace
03/16/2022, 4:12 AMKellen Mace
03/16/2022, 4:13 AMKellen Mace
03/16/2022, 4:13 AM