o/ i want to create a policy that only allows SELECT from one user
is that the correct way to do it?
Copy code
sql
CREATE POLICY "Only me" ON public.debug FOR SELECT USING ((uid() = 'e5475963-11f1-4afc-bb60-9b9036bde7bc'::uuid));
s
silentworks
04/13/2022, 1:17 PM
Yes that looks correct
r
Revxrsal
04/13/2022, 3:00 PM
Any idea why every time I query from the database with the js client it returns zero results? I logged in using github but for some reason supabase.auth.user() is always undefined
g
garyaustin
04/13/2022, 6:14 PM
If auth.user() is undefined right before your call you will not get any data back with that policy. You can use onAuthStateChange to see if you get the signin event. Is this all on client side code? If so anything in local storage after you signin?
r
Revxrsal
04/14/2022, 6:50 AM
the bug seemed to have fixed itself... inspecting local storage yesterday there wasn't a sign of supabase anywhere but this morning everything seems to work fine thanks for the help!