https://supabase.com/ logo
Join DiscordCommunities
Powered by
# javascript
  • s

    supa okezie

    04/30/2022, 8:52 AM
    Hi there. I am unable to install @supabase/auth-helpers-nextjs from yarn. When I run
    yarn add @supabase/auth-helpers-nextjs
    , I get the error
    An unexpected error occurred: "https://registry.yarnpkg.com/@supabase%2fauth-helpers-nextjs: Not found"
    . What can I do?
  • k

    Kadnium

    04/30/2022, 9:38 AM
    https://github.com/supabase-community/supabase-auth-helpers/issues/81#issuecomment-1106644362
  • s

    supa okezie

    04/30/2022, 9:39 AM
    Thanks. I guess I’ll update the README to include this then.
  • h

    hoesmean

    05/01/2022, 3:05 PM
    Hello everyone, when i query auth user i got null, how to get data
  • g

    garyaustin

    05/01/2022, 3:24 PM
    If you mean thru js or the api, you can't for security reasons. You can write an rpc security definer function to do that, or create a public profile table with a trigger function when a user is added. https://supabase.com/docs/guides/auth/managing-user-data
  • l

    Lucas T

    05/02/2022, 3:28 PM
    How do I get the user to be saved between sessions?
  • s

    szed

    05/02/2022, 9:13 PM
    Hey there! I'm looking at realtime, but am unable to make it work.
    Copy code
    const sub = this.$supabase
       .from("actions")
       .on("*", (data) => {
         console.log(data);
       })
       .subscribe();
    
      console.log(sub);
    My subscription look like this. The
    console.log(sub)
    shows that's it's seems to be ok and
    joined
    - Replication on my table is enabled, I can see under the websocket tab the events occuring, and i can see the subscription being created under the realtime schema in the Supabase Table's UI. So everything seems good, but i'm never reaching the callback. Nothing happen. I though it could be because of some RLS rules, but even with it being disabled on my table, nothing. Stack in Nuxt 2.x and this is inside a
    mounted
    method on my
    Index
    page. And i'm using my anon/public key Any idea? 🙏
    g
    • 2
    • 20
  • g

    garyaustin

    05/02/2022, 9:34 PM
    realtime not working
  • l

    lavenderlav

    05/04/2022, 8:55 AM
    Hi there how do I use
    getUserByCookie
    (using nextjs)
  • m

    Martin Kmieciak

    05/04/2022, 9:05 AM
    Here you can find some nice example for nextjs auth. https://github.com/supabase/supabase/tree/master/examples/nextjs-with-supabase-auth Also you can use, your own implementation
    Copy code
    export const getServerSideProps: GetServerSideProps = async ({ req }) => {
     // Get our logged user
     const { user } = await supabase.auth.api.getUserByCookie(req);
     // Check if the user is logged
     if (user === null) {
      // Redirect if no logged in
      return { props: {}, redirect: { destination: "/auth/login" } };
     }
     // If logged return the user
     return { props: { user } };
    };
  • l

    lavenderlav

    05/04/2022, 12:31 PM
    is
    getUserByCookie
    a server-side to be used or client side to be used?
  • l

    lavenderlav

    05/04/2022, 12:45 PM
    I cant seem to get
    getUserByCookie
    working
    s
    • 2
    • 2
  • l

    lavenderlav

    05/04/2022, 12:45 PM
    I checked
    req.cookies
    and the only cookies I got is google analytics
  • s

    silentworks

    05/04/2022, 5:47 PM
    I cant seem to get
    getUserByCookie
  • x

    Xzeta

    05/05/2022, 3:50 AM
    how would u mock session for testing? using React, rtl, jest
  • j

    jaitaiwan

    05/09/2022, 12:17 AM
    Hey folks, I'm wondering is there API doco for the objects returned by the supabase-js library?
    • 1
    • 1
  • j

    jaitaiwan

    05/09/2022, 1:13 AM
    Supabase API Doco
  • g

    gralp

    05/09/2022, 8:01 PM
    is there a way to increment a cell instead of reading it, incrementing it and writing it again?
    j
    • 2
    • 2
  • j

    jaitaiwan

    05/09/2022, 10:57 PM
    is there a way to increment a cell
  • y

    yuyu

    05/10/2022, 3:32 AM
    unit test with react, testing library and jest
    x
    • 2
    • 7
  • y

    yuyu

    05/10/2022, 3:41 AM
    Do you have good experience with testing? Are you able to give me feedback on my simple unit test? https://discord.com/channels/839993398554656828/973427221148614656
  • f

    fauh45

    05/10/2022, 2:11 PM
    Heya there! I'm currently using prisma to handle the postgres database of my supabase project, and is there a way to do relation of the prisma model to the auth model of supabase? I did found this answer https://www.reddit.com/r/Supabase/comments/ukelkx/comment/i7pldhz/?utm_source=share&utm_medium=web2x&context=3 but I'm not really sure how to approach that
  • u

    UnexampledSalt

    05/11/2022, 1:35 AM
    is it possible to filter files by 'id NOT IN' an array?
    g
    • 2
    • 6
  • g

    garyaustin

    05/11/2022, 2:47 PM
    Not in
  • f

    F0rce

    05/11/2022, 6:59 PM
    how do I select all columns where the column with type int is greater than value x ?
    s
    • 2
    • 8
  • f

    F0rce

    05/11/2022, 6:59 PM
    or can't I do that ?
  • e

    edgaras

    05/12/2022, 1:19 AM
    Is it easy to intercept network request and tamper with a form data? I am thinking how necessary is that I have an additional server side validation.
  • j

    jaitaiwan

    05/12/2022, 1:22 AM
    If there's a malicious extension I think so. I think it's harder with a malicious script if it were to somehow be injected.
  • j

    jaitaiwan

    05/12/2022, 1:22 AM
    What sort of things do you need to validate? It can probably be done with RLS and/or postgres functions
  • e

    edgaras

    05/12/2022, 1:41 AM
    I am hacking some quick stuff together, so of course the data structure is not ideal, but this is how it is: In database I have
    pricerange_from
    and
    pricerange_to
    . I fetch data, concatenate and display in a form select as range option values as such:
    5-10
    ,
    10-20
    ,
    50-10
    etc. Now user can update their profile by selecting a different price range. But I don't want them to choose a different range than given options. Of course only hackers will do that. But they could create their own option
    100-200
    and, as a result, update their
    pricerange_from
    and
    pricerange_to
    in the database to higher numbers than allowed.
1...606162...81Latest