ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข4y agoโ€ข
8 replies
Austin

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,
    },
  };
}
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.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

having trouble allowing users to delete their account from client
SupabaseSSupabase / help-and-questions
14mo ago
What is the approach of managing their own data?
SupabaseSSupabase / help-and-questions
3y ago
RLS not allowing to read data
SupabaseSSupabase / help-and-questions
2mo ago
Users unable to reset their password via Supabase Auth
SupabaseSSupabase / help-and-questions
4mo ago