GHOST
03/21/2022, 6:30 PMuser_id property that contains their idNeedle
03/21/2022, 6:30 PM/title command!
We have solved your problem?
Click the button below to archive it.Scott P
03/21/2022, 6:32 PM(auth.uid() = user_id)Needle
03/21/2022, 6:32 PMGHOST
03/21/2022, 6:33 PMGHOST
03/21/2022, 6:34 PMjs
await supabase
.from('user_profile')
.select('first_name')
.eq('user_id', user.id);GHOST
03/21/2022, 6:34 PM{ data: [], error: null } responseGHOST
03/21/2022, 6:34 PMtrueScott P
03/21/2022, 6:39 PMuser_id, you don't also need .eq('user_id', user.id) in your query - RLS will only return rows that match the conditions specified by the policy.
If you set the policy to true, it's going to allow any user, authorised or not, to access the entire table.
Make sure your user.id is the same as the user_id of at least 1 of the rows in the table. Content should be identical, but the type should also be identical (i.e. user.id is a UUID, so user_id should also be UUID)GHOST
03/21/2022, 6:40 PMGHOST
03/21/2022, 6:41 PMGHOST
03/21/2022, 6:42 PMGHOST
03/21/2022, 6:43 PMNeedle
03/21/2022, 6:43 PM