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

    oscar_gallog

    01/30/2022, 8:39 PM
    I have a Team table with an owner related to a user. A team can have N number of clients. And a N number of service_users. So, I want only users from the service_users or the owner of the team to access the clients. I tried creating a policy like this
    EXISTS(SELECT 1 FROM service_users where service_users.user_id = auth.uid()) OR EXISTS(SELECT 1 FROM teams WHERE teams.user_id = auth.uid))
    But I just get an error, any idea how to fix? I'm not an SQL expert as you can see
  • g

    garyaustin

    01/30/2022, 8:49 PM
    Is the last auth.uid)) really that versus auth.uid())
  • o

    oscar_gallog

    01/30/2022, 8:51 PM
    The error that I get is "service_users.user_id does not exist. But it does exist...kind of weird
    g
    • 2
    • 13
  • s

    Señor Bruno

    01/30/2022, 9:12 PM
    How can the user change the password ( lets say to make it stronger) without resetting it first?
    g
    a
    • 3
    • 5
  • s

    Señor Bruno

    01/30/2022, 9:57 PM
    So if the user is already logged in
  • u

    6ary

    01/30/2022, 10:06 PM
    Is it possible to call an RPC function from curl?
    g
    • 2
    • 6
  • g

    garyaustin

    01/30/2022, 10:36 PM
    reset password while logged in
  • t

    thecoderatekid

    01/30/2022, 10:39 PM
    is anyone else getting an error with Storage api empty bucket? Error: socket hang up I keep getting a connection error, maybe it is AWS acting wacky? not sure
  • d

    DanB

    01/31/2022, 12:22 AM
    Hi, Is there any way to make a CNAME for the storage URL ? I don't want to expose the public supabase url.
  • j

    jdgamble555

    01/31/2022, 2:18 AM
    Hey guys, https://supabase.com/docs/reference/javascript/auth-onauthstatechange - I notice the docs don't show anything about unsubscribing from the onauthstatechange observable, is this done automatically, or should be be doing this?
  • t

    Tundra

    01/31/2022, 2:33 AM
    Sorry if this is a stupid question but can you have more than 1 project on the selfhosted version?
  • m

    mathurah

    01/31/2022, 2:36 AM
    I'm trying to console log to see what my posts are looking like by calling this function in my component that displays the data from the database
    Copy code
    const getPosts = async () => {
        const response = await getAllPosts();
        console.log("this is response", response);
        // return response;
      };
    which refers to this function in my backend
    supabase.js
    file
    Copy code
    export const getAllPosts = async () => {
      const { data: posts, error } = await supabase
        .from("post")
        .select()
        .order("created_at", { ascending: false });
      if (error) {
        handleError(error);
      }
      console.log(posts);
      return posts;
    };
    but when I console log, I just see this in the console - is there anyway I can get access to the data I'm returning - am I writing this getPosts function wrong here?
    s
    • 2
    • 1
  • v

    vanderrlay

    01/31/2022, 4:09 AM
    Hi, im trying to set up realtime changes with realtime-js but I only receive DELETE payloads even though im listening to "*" all changes. Has anyone else had this problem and know a fix? the table has no RLS policies btw.
    g
    • 2
    • 3
  • g

    garyaustin

    01/31/2022, 4:28 AM
    Hi im trying to set up realtime changes
  • s

    Sourabh

    01/31/2022, 4:50 AM
    Can you try to put select('*'), and try again.
  • m

    mathurah

    01/31/2022, 4:51 AM
    got it working now! but I actually have another JS/supabase error I need help with. I'm trying to create users based on my authentication table but having trouble getting the table to populate. are you available to liveshare?
  • s

    Sourabh

    01/31/2022, 4:54 AM
    Actually I am not at my desk. But can you elaborate on this. Generally we create a postgres function to populate public.users or public.profiles when a new users signs up
  • s

    silentworks

    01/31/2022, 7:09 AM
    Getting data not working
  • j

    jbergius

    01/31/2022, 7:43 AM
    I'm trying to update my templates in the dashboard, but get the following error message. If I inspect the network tab it seems to have CORS-problems when hitting the
    /config
    route. Someone else has experienced this?
  • s

    silentworks

    01/31/2022, 7:50 AM
    Try logging out and logging in again, I had this error but after logging back in it was all working again.
  • j

    jbergius

    01/31/2022, 7:50 AM
    Tried multiple times, same error :/
    s
    • 2
    • 5
  • l

    listening to dev podcast

    01/31/2022, 9:20 AM
    Hi, I'm trying to install supabase and expect it to look like this
  • l

    listening to dev podcast

    01/31/2022, 9:20 AM
    But when I installed it on my ubuntu server it looks like this instead No login, cannot create a new project, etc. What did I miss? Edit: found my answer here

    https://youtu.be/LHYrqBb4q9I?t=362▾

    "...unfortunately a lot of our code, platform code on app.supabase.io a lot of our platform code is actually weaved into this dashboard so it's got things like billing, usage, various different secure items and because we host databases we don't want to expose any security concerns so we've been holding off on opening up just this dashboard but what we've been doing is incrementally releasing some of the parts of the dashboard..."
    s
    • 2
    • 2
  • z

    zander

    01/31/2022, 9:52 AM
    morning all, is it possible to get the database initialisation script for my project? e.g.
    create table ..., create policy ...
    etc etc I'd like to open source my project and have this as a was for others to run it themselves.
    s
    • 2
    • 4
  • s

    silentworks

    01/31/2022, 9:55 AM
    Self hosted Supabase
  • d

    dmitriy.dranko

    01/31/2022, 2:32 PM
    I set a cookie during login using
    await supabase.auth.api.setAuthCookie(req, res)
    , but when I sign out, I also try to do
    res.setHeader('Set-Cookie', 'sb:token=deleted; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT');
    . This works locally, but when deployed to Vercel, the
    sb:token
    persists on following requests and therefore I pass my middleware auth checks and access protected pages unintentionally. FYI, doing the cookie management inside of a NextJS API. My NextJS FE calls my internal NextJS API during sign in/sign out to add/remove cookies respectively. 1) Does Supabase have a cleaner way of removing cookies? 2) If not, is there any idea of what is going wrong? Thanks in advance. I love Supabase so far 🙂
    • 1
    • 1
  • d

    dmitriy.dranko

    01/31/2022, 4:53 PM
    Supabase not deleting auth cookies
  • l

    Lothar

    01/31/2022, 10:08 PM
    Can anyone help me figure this out? Why am I getting this error?
  • s

    stabacco

    01/31/2022, 10:21 PM
    you'll have to share a bit of information about your
    ingredient-prints
    table to know exactly. It looks to me like you are supposed to fill in some values in the foreign key for a field named
    master
    or similar.
  • l

    Lothar

    01/31/2022, 10:22 PM
    this is how i'm trying to create the FK
1...209210211...316Latest