https://supabase.com/ logo
Join Discord
Powered by
# help
  • m

    Maz

    11/28/2021, 3:24 AM
    Ah yep,
    supabase.auth.setAuth(token)
    is exactly what I needed, works great. No need to use the service key
  • a

    anothercoder

    11/28/2021, 3:36 AM
    setAuth(user's jwt) works for me too at the web client side. Small issue for me is that I still need to call createClient() with anon key. Realtime does not work if I call createClient() directly with user's jwt. I am trying not to give anon key to web client.
  • u

    user

    11/28/2021, 11:50 AM
    cant insert data if "preventDefault()" is defined
    Copy code
    js
    function sendMessage(e) {
        e.preventDefault()
        supabase.from("messages").insert([{name: user.user_metadata.name, message: input}])
      }
  • m

    Mél

    11/28/2021, 3:01 PM
    hello ! I don"t understand well how to use the bucket... How to find the path of the file , how to upload the right path... Spend hours looking for a guide on the web, but didn"t found something clear... Maybe i imagine for something they are not made for .... Any help is appreciated 🙂
  • a

    anothercoder

    11/28/2021, 3:16 PM
    E.g. Upload a file from js web client:
    Copy code
    const { 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-upload
  • m

    Mél

    11/28/2021, 3:35 PM
    thanks for your help, i'll have a look 🙂
  • m

    Mél

    11/28/2021, 3:41 PM
    another question 😉 Bucket are available publicly ? Is it possible to store files publicly accessible ?
  • a

    anothercoder

    11/28/2021, 3:44 PM
    Private by default, u can set to public in the dashboard. https://supabase.com/blog/2021/07/27/storage-beta
  • m

    Mél

    11/28/2021, 3:45 PM
    thank you, and could you tell what the public path look like ?
  • m

    Mél

    11/28/2021, 3:46 PM
    many infos on the page you shared , thanks
  • a

    anothercoder

    11/28/2021, 3:48 PM
    U can call the getPublicUrl: https://supabase.com/docs/reference/dart/storage-from-getpublicurl It looks like this:

    https://XXX.supabase.in/storage/v1/object/public/bucketname/XXX.jpg▾

  • m

    Mél

    11/28/2021, 3:48 PM
    thank you very much !!!!! 😉
  • k

    Khan W

    11/28/2021, 5:41 PM
    How can I disallow any read or writes on a table using RLS but still allow a function to return a value from that table? I want to restrict reads to being read only through a function but if I turn on RLS with just a
    false
    policy it fails the function as well.
    s
    g
    e
    • 4
    • 19
  • u

    user

    11/28/2021, 5:41 PM
    That sounds like a slightly dangerous approach to security
  • k

    Khan W

    11/28/2021, 6:14 PM
    Peep the thread I explained myself a little more. I agree, it is sketch but if you have a suggestion for how I could do it I’d love to hear it
  • t

    thecoderatekid

    11/28/2021, 8:29 PM
    Hi I am trying to use these apis in curl and they do not seem to work, only creating a bucket works and get buckets returns an empty array Are there some required headers that are missing from this swagger spec? https://supabase.github.io/storage-api/#/
  • t

    thecoderatekid

    11/28/2021, 9:26 PM
    i am working on a package for ios for supabase
  • k

    Khan W

    11/28/2021, 9:28 PM
    https://github.com/supabase-community/supabase-swift
  • k

    Khan W

    11/28/2021, 9:29 PM
    I'm one of the contributors on this repo and the other sub-repos, take a look at these!
  • k

    Khan W

    11/28/2021, 9:29 PM
    the repo for storage specifically: https://github.com/supabase-community/storage-swift
  • t

    thecoderatekid

    11/28/2021, 9:29 PM
    sorry but this package does not include auth or storage my package is only missing storage
  • k

    Khan W

    11/28/2021, 9:29 PM
    It actually does! It includes Auth, Realtime, Storage and Postgrest as submodules
  • k

    Khan W

    11/28/2021, 9:30 PM
    You can include supabase-swift in your package.swift and it'll automatically add the other dependencies
  • t

    thecoderatekid

    11/28/2021, 9:30 PM
    oh the documentation does not reflect it
  • t

    thecoderatekid

    11/28/2021, 9:30 PM
    but it still does not answer why the storage API does not work in postman
  • k

    Khan W

    11/28/2021, 9:31 PM
    Ah that's what the examples are supposed to reflect. I'll see if I can add a quick explainer that they add the other modules as dependencies similar to the js library.
  • k

    Khan W

    11/28/2021, 9:31 PM
    I can't answer that tho I haven't worked with the storage API so sorry, I'm sure someone else will be able to help
  • t

    thecoderatekid

    11/28/2021, 9:32 PM
    curl --location --request GET 'https://mysupabaseurl.com/storage/v1/bucket/' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer jwt here' \ --data-raw '' this returns an empty array when it is supposed to return a list of buckets which it does not.
  • t

    thecoderatekid

    11/28/2021, 9:35 PM
    I am using this as a reference: https://supabase.github.io/storage-api/
  • u

    user

    11/29/2021, 8:34 AM
    when using the supabase CLI to run my project locally, and using magic link for auth, how do I get the link to login? previously it was available at a different URL. (i think localhost:9000)
1...144145146...316Latest