Working on Auth flows. Struggling with getting client and server to both update when signing in or out.

This commit is contained in:
2025-05-30 10:06:34 -05:00
parent 22cf7be870
commit 28569c4f4e
11 changed files with 344 additions and 223 deletions

View File

@ -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()