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

    krithika

    12/20/2021, 11:59 PM
    @User would you happen to know what's happening with the second part of my question ("When signup is called, I'm getting no output in the console, and the page just reloads. Would you know what's causing that/how I could go about fixing/debugging this?")? I'm now getting this with both signin and sign up, and i'm not sure what's going on there
  • g

    Gianni

    12/21/2021, 2:18 PM
    Regarding the signIn function, is there a Build in way to handle it as an PopUp ? Or in another Window ? 0.o
  • a

    abaum

    12/21/2021, 11:40 PM
    we've just started seeing the exact same problem within our app. noticed another report here: https://github.com/supabase/supabase/issues/4577
  • j

    Jaeden

    12/22/2021, 4:34 PM
    How can I check if a specific image already exists in the Storage?
  • j

    Jaeden

    12/22/2021, 4:34 PM
    I don't see anything in the SDK that can return a boolean if an object exists or not
  • a

    anothercoder

    12/22/2021, 4:54 PM
    The objects are stored in the table storage.objects, so u can check if the record exists.
  • j

    Jaeden

    12/22/2021, 5:06 PM
    Oh! So I can do supabase.from(‘storage.objects’)? Gotcga
  • w

    willm

    12/22/2021, 7:47 PM
    is there a way for me to get the number of users with RLS?
  • k

    ktosiek

    12/23/2021, 9:59 AM
    do you mean "get the number of users, even if the users can't see other users"? You'll need a "security definer" function or view for that, they do bypass RLS.
  • w

    willm

    12/23/2021, 12:21 PM
    Ok thank you
  • w

    willm

    12/23/2021, 12:21 PM
    That’s exactly what I meant
  • j

    jsco

    12/23/2021, 10:20 PM
    Hey guys, Quick question regarding media storage: I'm working on basically a Google photos clone and am currently storing the filename in my db. When the user opens his photo-grid I have to call
    createSignedUrl
    for every single photo. Is that the intended way to store / retrieve media (in a private app) or am I missing something?
  • p

    poutingemoji

    12/24/2021, 9:02 AM
    im trying to build a pokemon like game. i have user specific pokemon data in my supabase table (exp, species number) and then i have their base stats and abilities in a json file. how would i combine both datasets into a complete pokemon? ive thought about using a helper function but then id have to import it everywhere i want a complete pokemon. is there a better way to handle this?
  • m

    Mihai Andrei

    12/24/2021, 2:08 PM
    Hello guys. Was the auto refresh token fixed for the js client? If i have a project with supabase auth, and i Let the page open for 1h, after i come back, i receive a jwt expired error. Do i need to catch the error and refresh it myself?
    s
    • 2
    • 2
  • s

    silentworks

    12/24/2021, 4:27 PM
    Auto refresh token
  • m

    MDobs

    12/24/2021, 7:31 PM
    on a re-enabled database I'm getting:
    "Invalid authentication credentials"
    when doing
    Copy code
    let { data: multiplayer, error } = await supabase
      .from('multiplayer')
      .select('*')
    curl also throws the same for this operation. But other APIs work correctly. The anon key is correct.
    s
    • 2
    • 5
  • s

    silentworks

    12/24/2021, 7:47 PM
    Invalid auth credentials
  • p

    Pragy

    12/25/2021, 8:52 AM
    What is the correct way to setup Supabase auth with Sveltekit (including server side auth)? There's a few tutorials out there, all of which seem to be doing something different. Is there a recommended way?
  • b

    beru

    12/26/2021, 6:21 AM
    i don't know if there is a single, correct way of doing this, but most of the guides and repos i've seen uses similiar techniques, which sends the jwt to the server and sets the cookie with the sveltekit hook. here's a great guide about it https://dev.to/ashleyconnor/authenticated-server-rendered-pages-with-sveltekit-and-supabase-pif
  • b

    beru

    12/26/2021, 6:25 AM
    the code for this article didn't quite work for me when i tried it, and i changed a few stuff. https://github.com/rmrt1n/auiss-nodejs-prototype this is working for me atm
  • p

    poutingemoji

    12/27/2021, 10:06 AM
    Copy code
    js
        const { data, error } = await supabase.from("users").select(`
          cur_student ( 
            uuid,
            subject,
            students (
              abilities (id)
            ) 
          )
        `).limit(1).single()
    this is how im querying a many to many relationship inside a foreign key right now and returns an object in the shape of
    Copy code
    js
    {
      cur_student: {
        uuid: 'fca886aa-1e75-4913-832f-3237703e4753',
        subject: 'sciences',
        students: { abilities: [Array] }
      }
    }
    what im trying to get is an object that looks like this
    Copy code
    js
    {
      cur_student: {
        uuid: 'fca886aa-1e75-4913-832f-3237703e4753',
        subject: 'sciences',
        abilities: [Array]
      }
    }
    how can i shift the abilities column up to my foreign key while still being able to query for it
  • b

    binajmen

    12/27/2021, 12:53 PM
    I've faced the same question but did not find a way to do it. Ping me if you find the solution!
  • t

    Toryn

    12/27/2021, 4:55 PM
    Hi everyone, I'm new to Supabase and attempting to spin it up with a brand-new Next.js project, but upon attempting to execute my first database query below, I'm getting error code 42501: "Permission denied for schema public."
    Copy code
    import { supabase } from "../lib/supabaseClient";
    
    export default function HomePage({ courses }) {
      return (
        <div>
          <p>Under construction...</p>
        </div>
      );
    }
    
    export async function getStaticProps() {
      const { data, error } = await supabase.from("course").select();
      console.log(data, error);
    
      return {
        props: {
          courses: data,
        },
      };
    }
    I have no role-level security set on any of my database tables, and I just created my database and first few example tables from scratch using the Supabase UI, so unfortunately I don't know where to start with how to fix this. I'm sure that I'm doing something wrong here, but I've read through the Supabase docs and I can't seem to find the solution. I very much appreciate any help that you can provide, thanks!
  • s

    Smardrengr

    12/27/2021, 11:19 PM
    Hi everyone (& @User ) I've been banging my head against the wall with a new project in SvelteKit using the Supabase
    auth
    API. Sign-up & login work, but for some reason, I cannot access the
    user
    object on the client.
    supabase.auth.setAuth($accessToken)
    returns nothing—no error, no data. I've documented the problem here: https://github.com/supabase/supabase/discussions/4634#discussioncomment-1865642 Can anyone point out what I'm missing? Thanks!
    s
    • 2
    • 2
  • l

    lorencerri

    12/28/2021, 1:02 AM
    Random question, but is the service_role not allowed to subscribe to changes? Subscribing to the wildcard doesn't seem to pick up on any changes, although I'm able to make changes to the database & bypass RLS. It's not that much of an issue though since I'm just using function hooks as an alternative, was just curious.
  • l

    lorencerri

    12/28/2021, 1:21 AM
    Are you trying to get the current signed in user's access token? You can do that with
    <supabase>.auth.session().access_token
  • b

    beru

    12/28/2021, 7:02 AM
    the example in the docs are for svelte only, the sveltekit approach is a bit different (to my knowledge at least, i've looked at plenty of examples online and all of them work in a similiar way). usually cookie based auth is used, and its set using the sveltekit hook. the user is stored in the server
    session
    object. You can access it through the
    getSession
    function during page load with the
    load
    function (similiar to getStaticProps in nextjs).
  • z

    Zenon

    12/28/2021, 12:27 PM
    Hey guys Is there a way I can add a key value pair to the raw_user_meta_data column of auth.users when signing in using Magic Link from Nextjs client?
    s
    • 2
    • 12
  • s

    silentworks

    12/28/2021, 12:48 PM
    Adding data to user_meta_data while using magic link
  • s

    silentworks

    12/28/2021, 12:51 PM
    SvelteKit with Supabase auth
1...394041...81Latest