Hi everyone, I'm working on a personal project wit...
# javascript
d
Hi everyone, I'm working on a personal project with supabase and nextjs. Currently I'm facing a strange issue, when I call
supabase.auth.session()
or
await supabase.from('profiles').select()
on nextjs page it works as expected but when I call these on
getStaticProps
, it just returns
null
or
Copy code
{
  error: null,
  data: [],
  count: null,
  status: 200,
  statusText: 'OK',
  body: []
}
If anyone faced this, or have any idea what's wrong, please share.
g
Can't help a whole lot other than if your getStaticProps stuff is running on the server rather than the client, you may need to deal with session and user jwt differently. If you have RLS on, your select result seems like you don't have access, probably with no jwt.
d
thanks for the reply, yeah, I think it's because of RLS.