dijonmusters / build-a-saas-with-next-js-supabase-and-stripe

292 stars 67 forks source link

Egghead Tutorial: Updating `stripe_customer` not working with hook. #7

Open stoplion opened 2 years ago

stoplion commented 2 years ago

Hi, I'm doing the Egghead tutorial. This lesson add hook function to add stripe_customer to Profile.

When I remove row level security in Profile table, stripe_customer updates. But with it on, it doesn't. I added the 'read' row level security from prior lesson. Has something changed?

With row level security on

const status = await supabase
    .from('profile')
    .update({
      stripe_customer: stripeCustomer.id
    })
    .eq('id', req.body.record.id);

status is

status: 404
statusText: "Not Found"

When I turn off security it's status 200.

callmejumeh commented 1 year ago

Try to use your Service Role Key to bypass RLS.