Allowing users to view their own data

Hey everyone. Frontend dev has been kicking my butt, and I have a quick question: I have RLS enabled for one of my tables with the notion that a user should only be able to view their own bills. I have a user_id foreign key on my table, and this works just fine in postman utilizing the users bearer token.

My question is: How do I configure this on my getServerSideProps function if I can't pass in hooks (session, user_id, etc.)?

export async function getServerSideProps() {
  const { data: bills } = await supabase
    .from('bills')
    .select(`name, amount`)
    .eq('paid', false)

  return {
    props: {
      bills,
    },
  };
}


I get an empty array back each time.
Was this page helpful?