https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Is inviteUserByEmail only for inviting people to the supabase organisation?
    j

    Jumper

    04/27/2023, 1:10 PM
    I want to give my users the ability to send an invite link to other people which will link their account. But I'm getting an "User not allowed" error when calling that method. Is this the right use for this method? Is there another way to do this?
    s
    • 2
    • 7
  • new team member not receiving invite
    f

    fred kufner

    04/27/2023, 1:30 PM
    I add a team member to my organization and he did not receive email invite
    s
    t
    g
    • 4
    • 4
  • Calling Google API Guidance
    j

    jeno

    04/27/2023, 1:32 PM
    Hi i am hoping to get some guidance. I want to be able to allow my users to import their contacts from their google gmail into my website. Ideally the user should click an β€œimport” button whereby a pop up window requests the user to log into their gmail/authorise. And after so, contacts can be exported back to the website. I am quite new to this whole web dev arena. My question is, for the code to authenticate and call the gmail api, do I write this in the edge function to keep it secure, also is it recommended to store the refresh token in the database?
  • Android having issues with row level security
    u

    π”π”¬π”€π”žπ”« (He/Him)

    04/27/2023, 1:54 PM
    Hi I am pretty new to Supabase but enjoying it so far. I am trying to build a react native app for android, and am using the default setup with expo. But I am having an issue. I have created a simple table "user_profiles", which just contains extra data on the user. This is the code I use to get the user let { data: user_profiles, error } = await supaClient .from('user_profiles') .select('id') .filter("user_id", "eq", userId); console.log('user_profiles', user_profiles); When I run in the browser my setup work, I get the associated profile, but when I run on android it logs an identical object, but the data field is empty, if I disable RLS then it works fine on both but that's obviously not a solution. Does anyone know what I might be doing wrong?
    g
    • 2
    • 46
  • Realtime update subscription not triggering
    g

    gilbert

    04/27/2023, 2:19 PM
    I have an RLS-enabled
    chats
    table. However, when trying to listen for postgres changes, nothing happens when I insert, update, or delete chat records. 1. I have enabled realtime via the ui (see screenshot 1) 2. Replication is enabled (see screenshot 2) 3. The browser user has already successfully authenticated 4. I can query chat rows successfully using the same js client (thus the RLS policy doesn't seem to be the issue) 5. I'm running supabase locally 6. The websocket in the browser connects successfully Here is my listening code:
    Copy code
    const channel = supabase
      .channel('table-db-changes')
      .on(
        'postgres_changes',
        {
          event: '*',
          schema: 'public',
          table: 'chats',
        },
        (payload) => console.log('CHANGE', payload)
      )
      .subscribe()
    What can I do to debug? I would expect this simple case to work easily, so I must be doing something wrong.

    https://cdn.discordapp.com/attachments/1101150624663490570/1101150624915128411/Screenshot_2023-04-27_at_9.10.02_AM.pngβ–Ύ

    https://cdn.discordapp.com/attachments/1101150624663490570/1101150625191964773/Screenshot_2023-04-27_at_9.11.00_AM.pngβ–Ύ

    m
    g
    • 3
    • 24
  • I would like a Battle.net provider for auth. can I write a custom provider or help create it?
    m

    mdhippie

    04/27/2023, 3:06 PM
    What the title says. Is it possible to write a custom provider? Or can I help add it to supabase-js in some way? If I can help add it to supabase-js, can someone tell me where to look?
    g
    • 2
    • 2
  • Test environment?
    v

    vinciarts

    04/27/2023, 3:08 PM
    Currenly I do the dev directly on the single supabase, which not very safe and stable. If there's a way using test env and how to active it?
    v
    • 2
    • 1
  • New row violates row level security, for user_profile
    k

    KelsieMurphy

    04/27/2023, 4:00 PM
    As some other folk have asked (I've looked over all their responses, but no luck getting an answer from them), i have a user_profile table attached to my auth.users, linked through a user_id column. With the RLS policies disabled, it works absolutely fine in the front-end of my application. With them enabled, it throws an error (even when I set the insert policy to anon) I've attached an image of the policies screen, and the ones I have. The check is simply '(auth.uid() = user_id)' on each of them in the user_profile. The flow is that on signup, the user_profile is created, and then after this an initial job_application_period row is created. Right now I am doing this in Javascript functions that call each other, although I do intend on turning this into a trigger once I become more proficient at them, as when I tried it it became pretty complex for me. Hope someone can help, I feel like i've tried everything, and I obviously don't want them left disabled.

    https://cdn.discordapp.com/attachments/1101176118486253629/1101176119534821568/Screenshot_2023-04-27_at_16.57.48.pngβ–Ύ

    g
    • 2
    • 9
  • Limitations!
    b

    brainborne

    04/27/2023, 4:05 PM
    Hi all, Curious if there are any column/row limits? I’m assuming not since the pricing is based on GB? Thanks! Bryan
    g
    • 2
    • 1
  • Any recommendations for creating a public doc site from the OpenAPI spec that Supabase publishes?
    r

    rjdavis

    04/27/2023, 4:16 PM
    I would like to create a site where I can decorate the OpenAPI spec which Supabase publishes and make it public. It would be even better if I can add content via GitHub Pull Requests. I'm thinking something like a GitHub Pages that can read and stay up to date on the Supabase OpenAPI spec. OpenAPI Spec from Supabase: https://{{projectId}}.supabase.co/rest/v1/?apikey={{anonKey}} Does anyone have recommendations on tooling that can help with this?
  • Cannot find module '/server' or its corresponding type declarations.
    v

    ven

    04/27/2023, 4:21 PM
    Hello I have my import_maps defined so
    Copy code
    {
      "imports": {
        "/": "./",
        "./": "./",
        "server": "https://deno.land/std@0.168.0/http/server.ts",
        "@supabase/supabase-js": "https://esm.sh/@supabase/supabase-js@2",
        "assert": "https://deno.land/std@0.184.0/testing/asserts.ts"
      }
    }
    but i get the error. help appreciated. tia

    https://cdn.discordapp.com/attachments/1101181392529920133/1101181393180053514/import_error.pngβ–Ύ

    s
    • 2
    • 2
  • Should I be adding a trigger to prevent users from updating their public profile's userId?
    v

    Vik

    04/27/2023, 4:25 PM
    I have a public profiles table where the
    profile_id
    is a foreign key to the
    auth.users
    table. Based on my RLS, if the
    auth.uid() = profile_id
    the are allowed to update their profile information. Should I also include a trigger function that runs before each update to ensure no malicious users update their
    profile_id
    to someone else's or do something wrong? Is this overkill or something valid I should include.
    j
    g
    • 3
    • 5
  • signInWithOAuth getting access in data
    f

    formigueiro

    04/27/2023, 5:41 PM
    I 'm not getting access in data when i log with provider, for example twitch
    Copy code
    js
    const { data, error } = await supabase.auth.signInWithOAuth({
      provider: 'twitch'
      options: {
        scopes: '....'
      }
    })
    const oAuthToken = data.session.provider_token
    after I click to log in, it goes to the redirect page and when I come back I don't have access to the data
    j
    • 2
    • 4
  • Fetching Data from Supabase CLI always returns an empty array
    l

    lukas.

    04/27/2023, 5:56 PM
    I've already disabled RLS for the Table
    s
    g
    • 3
    • 9
  • webhook to trigger edge function
    t

    tobowers | Crypto Colosseum

    04/27/2023, 6:01 PM
    Is there a way to use a webhook to trigger an edge function? I can see how to do that relatively easily manually copying URLs for production, but what about locally?
    s
    • 2
    • 1
  • JS/Client Side Roles
    t

    thefreedompeople

    04/27/2023, 6:18 PM
    Hey all! I have FE dev skills but my BE skills are lacking, because of this I use Supabase as my BaaS solution, I love it. My goal is to show/hide content in my SvelteKit App based on a certain role. However all users that are authenticated via in have the same role: "authenticated" My two questions are: How do I get different roles sent to the FE app? What is the best way to show/hide features of my FE app based on these roles? Thank you in advance for any advice : )
    g
    • 2
    • 1
  • 'posts' table and 'post_likes' table. How to join?
    p

    pippin_mole

    04/27/2023, 6:38 PM
    I have a ``posts`` table, and a ``post_likes`` table. The ``post_likes`` table foreign keys a ``post`` (Many to one). How do I query the database so I can join the ``post_likes`` onto the ``post`` object, so I can do ``post.likes.map(...)`` in my code?
    k
    g
    • 3
    • 13
  • Where do you self-host?
    s

    sten

    04/27/2023, 7:03 PM
    Really like supabase so I'd thought I should try self hosting since I'm experimenting with a couple of projects. Where do you currently self host? So far, it's seems that Digital Ocean is the most popular place?
    d
    • 2
    • 2
  • Auth is not working on localhost
    m

    mdhippie

    04/27/2023, 8:08 PM
    I have auth setup with Discord on production and on my local db. I'm using the
    @supabase/auth-ui-react
    UI and when I click on the Discord button it redirects me to discord login and everything works fine. But when I click on
    authorize
    I get redirected back to the page where I signed in from (localhost:3000) and nothing happens. I am not authenticated and there is no user entry in my DB. I can see some new searchparams have been added to my URL though
    Copy code
    http://localhost:3000/en?code=0ou3xCzrKT4JsSkkNlbJaNMBrtDnEL&state=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODI2MjYyMjYsInNpdGVfdXJsIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwIiwiaWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJmdW5jdGlvbl9ob29rcyI6bnVsbCwicHJvdmlkZXIiOiJkaXNjb3JkIiwicmVmZXJyZXIiOiJodHRwOi8vbG9jYWxob3N0OjU0MzIzL2F1dGgvdjEvY2FsbGJhY2sifQ.lQWi1bwjERN8HBvlf7rW4AwhQgqvXXpDFZUsWX4pS-M
    I have tried setting the
    redirectTo
    to something else but it's always redirecting me to the page where I signed in from.
    Copy code
    tsx
    <Auth
      supabaseClient={db}
      appearance={{ theme: ThemeSupa }}
      providers={['discord']}
      redirectTo="http://localhost:54323/auth/v1/callback"
    />
    I couldn't find my answer in the docs. There is very little useful information regarding auth tbh and it's very scattered/unfocused 😦
    s
    g
    • 3
    • 28
  • Why there is so many connections to postgres role?
    m

    MrAmG17

    04/27/2023, 8:13 PM
    I have noticed that postgres role has at least 10 connections and running
    SELECT count(*) FROM pg_stat_activity WHERE datname = current_database();
    shows 7 is this a normal behavior?

    https://cdn.discordapp.com/attachments/1101239703245693068/1101239703522521098/image.pngβ–Ύ

  • NSFW content allowed on Supabase?
    s

    sweetamino

    04/27/2023, 8:28 PM
    Hi I'd like to clarify the Acceptable Use Policy (https://supabase.com/aup). It obviously prohibits illegal content, but what about legal adult content? It says "Offensive Content. Content that is defamatory, obscene [...]" It seems a bit vague so I thought I'd clarify. Are legal NSFW images allowed on Supabase's web services? Launching a site that will allow users to upload NSFW images. I know I will need to sort out moderation quite well but wanted to see if Supabase is a good fit for this.
  • Next.js supabase cookies after signInWithOAuth not saving across routes
    g

    gtims123

    04/27/2023, 8:58 PM
    Could the issue be because the cookie Domain isn't the same as my aws amplify domain?
  • Having trouble accessing Storage on local deployment from Edge Function
    u

    *ansible

    04/27/2023, 8:52 PM
    I'm trying to get my local env setup and this is my only blocker. I have a public bucket that I need to write to, I duplicated policies from my production bucket, but I'm using the service_role_ley anyways, so that should be bypassing RLS. My edge function cannot seem to access storage. Gives me this error: request to http://supabase_kong_supabase:8000/storage/v1/object/bucket/folder/9.mp3 failed, reason: getaddrinfo ENOTFOUND supabase_kong_supabase"
    v
    • 2
    • 6
  • Struggling to create a query with 2 join tables and conditional chaining
    k

    Kcrik

    04/28/2023, 10:44 AM
    It really depends on what you wish to achieve, as in, in what form ? I would just do a conditional rendering on the frontend if I were you.
  • Help with this join
    o

    osamita

    04/27/2023, 9:40 PM
    I have three tables: users, people, and system_users. A system_user belongs to a person, and a person belongs to a user. I read this in the documentation: Filtering through foreign tables: /// const { data, error } = await supabase .from('cities') .select('name, countries(*)') .eq('countries.name', 'Estonia') Note: If the filter on a foreign table's column is not satisfied, the foreign table returns [] or null but the parent table is not filtered out. If you want to filter out the parent table rows, use the !inner hint /// and this is just what I need. I need to filter users table results based on a system_user or person filter, but I dont understand exactly how to do that.
    k
    • 2
    • 2
  • How do I get the UUID of the user calling a function
    u

    π™²πš‘πšžπšžπš”

    04/27/2023, 11:25 PM
    Say have the following code. And say Johnny Boy called the funtion from the frontend passing the number 4.
    Copy code
    create or replace function meal_order(a int) returns void as $$
      select (select users where uuid = caller.uuid) || ' called, he wants, ' || a || ' burgers.';
    $$ language sql;
    The expected output is "Johnny Boy called, he wants 4 burgers." I am aware of how to pass the user id from client. What I want is a way for "caller.uuid" to get the UUID without it being passed into the funtion itself.
    g
    s
    • 3
    • 15
  • Errors when creating tables, trying to upgrade: failed to fetch
    w

    wzlz

    04/27/2023, 11:45 PM
    Hi, It seems like there is some error somewhere in my project although there are no errors in any of the logs. When I try to create a new table I get "An error has occurred: Failed to fetch" and when I try to upgrade my instance (so I can export the data) I also get "Failed to update subscription: An error has occurred: Failed to fetch". Is there a way to restart the instance or figure out why this is suddenly happening? Thanks
  • has anyone used pganalyze with Supabase?
    o

    ostoto

    04/28/2023, 2:09 AM
    does it work well? are there any alternatives if not?
  • UsΓ­ng supabase auth across mutiple domains.
    g

    gutsyphilip

    04/28/2023, 3:06 AM
    Hi, I'm Philip Obosi. I built https://noggle.so, a tool that allows Notion users turn their notes on Notion into online courses. Noggle is built on top of Supabase, however I have recently run into serious issues I'm unsure how to solve. Noggle sites are hosted on subdomains e.g https://javascript-algorithms.noggle.so. Recently, I rolled out a custom domain feature that allows users add a custom domain to the hosted course site e.g https://javascriptalgorithms.dev As a consequence, authentication is broken and only works on the subdomain. My questions is: Is there some way to authenticate users successfully on custom domains added by users using the same project/infrastructure? I would really appreciate whatever support I could get to make this work for my users as this is a deal breaker for serious creators
    s
    • 2
    • 1
  • Having Trouble Implementing the RealTime Subscribe Feature
    m

    Mirik

    04/28/2023, 8:47 AM
    Have you turned on "real time" mode in supabase dashboard ? for the table "Legal"
    g
    s
    c
    • 4
    • 3
1...194195196...230Latest