https://supabase.com/ logo
Join Discord
Powered by
# javascript
  • u

    user

    08/03/2021, 11:27 AM
    Has someone ported postgrest-js for deno?
  • m

    Mihai Andrei

    08/03/2021, 2:43 PM
    Hello guys. I don't know if this is the right channel but, i was searching a lot of how to make requests on the server as a particular user, and found a way so you can use the RLS errors.
    Copy code
    js
    const supabase = createClient(supabaseurl, anon)
    const jwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjI4MDA0MTczLCJzdWIiOiI5ZmNkN2VmYi1lOTBmLTRlYWUtYmJhNS0zYzAxMDMwMDg5ZGMiLCJlbWFpbCI6Im1paGFpLmFuZHJlaSsyQG1vZGV4LnRlY2giLCJwaG9uZSI6IiIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6ImVtYWlsIn0sInVzZXJfbWV0YWRhdGEiOnt9LCJyb2xlIjoiYXV0aGVudGljYXRlZCJ9.OTJ89KjBMcbVI5d-ll4YZl7pyUr8tkUdwQkEht-clnc"
    supabase.auth.setAuth(jwt);
    You just need to call supabase.auth.setAuth(jwt).
    b
    s
    • 3
    • 6
  • b

    burggraf

    08/03/2021, 4:45 PM
    Making requests from the JS client as a specific user
  • c

    claud9

    08/03/2021, 6:09 PM
    šŸ‘‹ , I have a table which has a foreign key that gets a team member... when I do a select, it works as expected and returns the team member
    .select('id, note, timestamp, team(*)')
    but when I do
    subscribe()
    on the same table, I just get back the actual foreign key ID. Is there a way to get the same payload as when I select through subscribe? Or do I have to manually get it from the other table again.
  • c

    claud9

    08/03/2021, 6:23 PM
    I went ahead and just selected the things I needed from my other table but if anyone has any workarounds so there is one less API call that would be great šŸ™
  • m

    Mihai Andrei

    08/03/2021, 8:19 PM
    Hey guys! In a React app, if you use the supabase-js on the client, after you login, if you make an insert/select, is it going to pass the token automatically to supabase in order to use the policies? Or you need to pass the token somehow
  • t

    Trey

    08/03/2021, 8:57 PM
    That's what I read too, but I've never even used an action yet. Is there a simple way to log the user out with a mutation from the component?
  • w

    Wickey

    08/03/2021, 9:21 PM
    It will pass it automatically, but bear in mind that the default setting is that the user needs to verify their email first, which you can turn off in settings.
  • m

    Mihai Andrei

    08/03/2021, 9:51 PM
    Thanks a lot!
  • s

    Skolder

    08/03/2021, 11:46 PM
    well, generally, you'd want to store the authentication state of the user in order to safeguard parts of the app, you could retain that state on a sort of root level component? but that's an anti-pattern tbh
  • f

    FL

    08/04/2021, 3:03 AM
    Hi guys does the react package for supabase work with React-Native?
  • a

    Azura

    08/04/2021, 3:46 AM
    Hey @User, I remember you are working on NextJS. Is and <> any different in performance?
  • f

    Flyken

    08/04/2021, 3:47 AM
    wait wot
  • f

    Flyken

    08/04/2021, 3:47 AM
    oh
  • f

    Flyken

    08/04/2021, 3:47 AM
    i don't think so, i've only used <> , i honestly think they're the exact same
  • n

    Nebula

    08/04/2021, 3:48 AM
    its the same
  • n

    Nebula

    08/04/2021, 3:48 AM
    just diff syntax
  • a

    Azura

    08/04/2021, 3:48 AM
    Okay, I've just started with NextJS so just wondering.
  • f

    Flyken

    08/04/2021, 3:48 AM
    ooooo
  • f

    Flyken

    08/04/2021, 3:48 AM
    want some assistance?
  • a

    Azura

    08/04/2021, 3:48 AM
    Sure.
  • f

    Flyken

    08/04/2021, 3:48 AM
    i love nextjs :)
  • n

    Nebula

    08/04/2021, 3:48 AM
    yes its epic
  • f

    Flyken

    08/04/2021, 3:48 AM
    ima Dm you
  • n

    Nebula

    08/04/2021, 3:49 AM
    i was wondering this as well
  • n

    Nebula

    08/04/2021, 3:49 AM
    i tried and it complained about localstorage being undefined
  • y

    YelloJello

    08/04/2021, 10:45 AM
    there is no workaround rn, it's one of the first things i tried it'll take some time for something decent to land tbh
  • c

    claud9

    08/04/2021, 1:45 PM
    Good to know, thank you!
  • v

    Village

    08/04/2021, 9:07 PM
    Do I need an anon key or something for the PostgREST client?
  • v

    Village

    08/04/2021, 9:08 PM
    Or just the URL?
1...678...81Latest