row level security and react query
Hi,
I am using react query on a side project.
When I login and land on the dashboard, I have a table with item coming from a Supabase table.
This table a RLS to display only row from the auth user (auth.uid() = user_id)
But, when the query run for the first time, I get the empty array (RLS block). Nevertheless, when i leave the window and come back (so that react query refetch the data) I do get the data.
I tried to add a a enable option to pause if there is no user but the user is present at the first query..
I am understand why I don't get the data for the first time
Thanks in advance for your help !
I am using react query on a side project.
When I login and land on the dashboard, I have a table with item coming from a Supabase table.
This table a RLS to display only row from the auth user (auth.uid() = user_id)
But, when the query run for the first time, I get the empty array (RLS block). Nevertheless, when i leave the window and come back (so that react query refetch the data) I do get the data.
I tried to add a a enable option to pause if there is no user but the user is present at the first query..
I am understand why I don't get the data for the first time
Thanks in advance for your help !