Maz
11/28/2021, 3:24 AMsupabase.auth.setAuth(token)
is exactly what I needed, works great. No need to use the service keyanothercoder
11/28/2021, 3:36 AMuser
11/28/2021, 11:50 AMjs
function sendMessage(e) {
e.preventDefault()
supabase.from("messages").insert([{name: user.user_metadata.name, message: input}])
}
Mél
11/28/2021, 3:01 PManothercoder
11/28/2021, 3:16 PMconst { data, error } = await supabase.storage
.from("your bucket")
.upload(
"any path/u like/" + file.name,
file,
{
cacheControl: "0",
upsert: true,
}
);
The path+filename is essentially a unique key (string). You can choose any path+filename as u like.
https://supabase.com/docs/reference/javascript/storage-from-uploadMél
11/28/2021, 3:35 PMMél
11/28/2021, 3:41 PManothercoder
11/28/2021, 3:44 PMMél
11/28/2021, 3:45 PMMél
11/28/2021, 3:46 PManothercoder
11/28/2021, 3:48 PMhttps://XXX.supabase.in/storage/v1/object/public/bucketname/XXX.jpg▾
Mél
11/28/2021, 3:48 PMKhan W
11/28/2021, 5:41 PMfalse
policy it fails the function as well.user
11/28/2021, 5:41 PMKhan W
11/28/2021, 6:14 PMthecoderatekid
11/28/2021, 8:29 PMthecoderatekid
11/28/2021, 9:26 PMKhan W
11/28/2021, 9:28 PMKhan W
11/28/2021, 9:29 PMKhan W
11/28/2021, 9:29 PMthecoderatekid
11/28/2021, 9:29 PMKhan W
11/28/2021, 9:29 PMKhan W
11/28/2021, 9:30 PMthecoderatekid
11/28/2021, 9:30 PMthecoderatekid
11/28/2021, 9:30 PMKhan W
11/28/2021, 9:31 PMKhan W
11/28/2021, 9:31 PMthecoderatekid
11/28/2021, 9:32 PMthecoderatekid
11/28/2021, 9:35 PMuser
11/29/2021, 8:34 AM