Working on Auth flows. Struggling with getting client and server to both update when signing in or out.
This commit is contained in:
@ -76,8 +76,24 @@ create policy "Anyone can upload an avatar." on storage.objects
|
||||
-- CREATE POLICY "Public statuses are viewable by everyone." ON statuses
|
||||
-- FOR SELECT USING (true);
|
||||
|
||||
-- CREATE POLICY "Users can insert statuses for any user." ON statuses
|
||||
-- FOR INSERT WITH CHECK (auth.role() = 'authenticated');
|
||||
-- -- RECREATE it using the recommended sub-select form
|
||||
-- CREATE POLICY "Authenticated users can insert statuses for any user."
|
||||
-- ON public.statuses
|
||||
-- FOR INSERT
|
||||
-- WITH CHECK (
|
||||
-- (SELECT auth.role()) = 'authenticated'
|
||||
-- );
|
||||
|
||||
-- -- ADD an UPDATE policy so anyone signed-in can update *any* status
|
||||
-- CREATE POLICY "Authenticated users can update statuses for any user."
|
||||
-- ON public.statuses
|
||||
-- FOR UPDATE
|
||||
-- USING (
|
||||
-- (SELECT auth.role()) = 'authenticated'
|
||||
-- )
|
||||
-- WITH CHECK (
|
||||
-- (SELECT auth.role()) = 'authenticated'
|
||||
-- );
|
||||
|
||||
-- -- Function to add first status
|
||||
-- CREATE FUNCTION public.handle_first_status()
|
||||
|
Reference in New Issue
Block a user