Supabase query data based on uid does not work
See original GitHub issueI created the table and policy via UI and I always get an emtpy list. If my expression is just true I get all my rows.
var response = await supabaseClient.from('portfolios').select().execute();
if (response.error == null) {
final results = response.data as List<dynamic>;
return results.map((e) => Portfolio.fromMap(e)).toList();
}
throw Exception("Error while fetching portfolios");
I tried as well everything via script:
CREATE TABLE portfolios (
id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name text,
user_id uuid references users (id)
);
alter table portfolios
enable row level security;
create policy "Read own portfolios" ON public.portfolios for select USING ((auth.uid() = portfolios.user_id));
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Managing User Data - Supabase
Managing User Data. For security purposes, the auth schema is not exposed on the auto-generated API. Even though Supabase provides an auth.users table, ......
Read more >Supabase Documentation
This reference documents every object and method available in Supabase's isomorphic JavaScript library, supabase-js. You can use supabase-js to interact ...
Read more >Part Three: Policies - Supabase
Supabase Auth Deep Dive Part 3: User Based Access Policies. ... us much more control over what data your users can read to...
Read more >Auth | Supabase
When you need granular authorization rules, nothing beats PostgreSQL's Row Level Security (RLS). Policies are PostgreSQL's rule engine. They are incredibly ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
yes please!
It was the singleton/no token in header issue. Thanks for your help!