o/ i want to create a policy that only allows SELE...
# off-topic
r
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
Yes that looks correct
r
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
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
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!