Fix avatar upload

- Fix the display of an already updated avatar
- Fix the storage policy. Only authenticated users can upload an avatar
This commit is contained in:
Michael
2021-07-20 10:31:17 +02:00
parent ecf4ef7be5
commit 598fd2671f
2 changed files with 4 additions and 4 deletions

View File

@@ -33,9 +33,9 @@ create policy "Avatar images are publicly accessible."
on storage.objects for select
using ( bucket_id = 'avatars' );
create policy "Anyone can upload an avatar."
create policy "Any authenticated user can upload an avatar."
on storage.objects for insert
with check ( bucket_id = 'avatars' );
with check ( bucket_id = 'avatars' and auth.role() = 'authenticated' );
-- inserts a row into public.profiles
create function public.handle_new_user()