https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Roadmap for self hosted feature addition (Edge functions, DB Webhooks)
    m

    Marvin (M123)

    01/01/2023, 8:45 PM
    Hey everyone, I was wondering if there is an open roadmap as to when features such as edge functions and db webhooks will be made available for self hosted instances. I can only find that "The Functions interface is coming soon."(1) but is there more specifics. Is it more a matter of a couple of weeks or will it take several quarters? https://supabase.com/docs/guides/resources/supabase-cli/local-development#limitations
    n
    g
    +3
    • 6
    • 8
  • Connecting AWS API Gateway Authorization
    m

    Martacus

    01/01/2023, 9:40 PM
    I am using an AWS API Gateway to talk to my backend. When users want to upload something I want to make sure they are authorized. So I send the bearer token with the request API gateway can check if the user is logged in. When I want to use JWT authorization aws is asking for an issuer url.
    Enter the issuer URL of your identity provider, commonly found in the issuer field of the Authorization Server’s well-known metadata endpoint.
    Now it may be me not understanding correctly. But I cannot find any issuer URL on the supabase console. Nor do I see it in the docs. Is this how I'm supposed to authorize users? Now there is also the option to use code myself to authorize the request. Though I was hoping I wouldn't have to do that. After reading some more I see that I may have to write a lambda that uses the secret to authorize my JWT tokens. Is that right?
  • ASP.Net securing API
    d

    DirtyNative

    01/01/2023, 10:15 PM
    I am trying to implement Supabase into my flutter frontend and ASP.Net backend. The frontend part works as expected, but I dont know how to secure my WebAPI with Supabase. Are there any examples or is Supabase not meant to be used for this?
    m
    • 2
    • 4
  • python client not sending authenticated requests
    m

    Maark

    01/01/2023, 10:19 PM
    i'm running a gradio app via colab. I authenticate a session via discord oauth and print out the resulting
    client.current_session
    and
    client.current_user
    , things look good. but when i then insert a row into a table with an RLS policy that only allows authenticated users to insert, it fails. here's the code:
    Copy code
    # url is retrieved via gradio _js func, and then I s/#/?/ bc I think only url params, not url fragments, are supported here
    supabase_client.auth.get_session_from_url(url = url, store_session = True)
    supabase_client.table("curations_metadata").insert({"name": "test"}).execute()
    I've also tried setting the session via
    client.set_session
    and passing the refresh token that is found in the url fragment. I can again print out the session just fine, but can't seem to be able to INSERT with it. i'm trying to insert a row that has a column with default value
    uid()
    . When I change the RLS policy to allow
    anon
    users, the insert works, but the user_id column is NULL. any thoughts on why the supabase client isn't apparently sending an authenticated request for the insert?
    g
    • 2
    • 3
  • How to make confirm email to multilingual?
    l

    limonCoder

    01/01/2023, 11:04 PM
    I have a website that is available in both German and English, and when a user signs up using a magic link, a confirmation email is sent to them. How can I make sure that the confirmation email is sent in the correct language for the user, depending on whether they are using the German or English version of the website?
  • .maybeSingle() not working as expected
    n

    Nin

    01/02/2023, 12:20 AM
    Hi all, I have a .maybeSingle() in my code because it either returns 0 or 1 rows. However, I'm still getting the below error msg:
    Copy code
    json
    {
        "code": "PGRST116",
        "details": "Results contain 0 rows, application/vnd.pgrst.object+json requires 1 row",
        "hint": null,
        "message": "JSON object requested, multiple (or no) rows returned"
    }
    How can this be? Below is my code to retrieve the data:
    Copy code
    javascript
    return await supabaseClient
          .from('intakes')
          .select('id')
          .eq('user_id', user?.id)
          .maybeSingle()
    g
    b
    • 3
    • 5
  • What is Timestampz - Format value?
    t

    thecoderatekid

    01/02/2023, 12:34 AM
    I am trying to create the timestamp in the format in the db Timestamp produced by supabase - "2022-12-30 02:00:42.913409+00" What is the string formatter for this type of date? I cannot seem to figure out the "+00" part thanks! 'yyyy-MM-dd HH:mm:sssssss???'
    u
    • 2
    • 5
  • Row Level Security - Multi tenant
    s

    Sheprekt

    01/02/2023, 2:05 AM
    Hi everyone. I have two tables,
    teams
    and
    team_members
    . As you can expect,
    team_members
    has a
    team_id
    and a
    user_id
    . I want a user to be able to create a team, so I create a policy for
    insert
    operations on the
    teams
    table to just allow any authenticated users to create a team. Simple so far. I set up a trigger to insert a
    team_members
    record on the creation of a team. I almost want to bypass RLS here somehow though - because I also have a policy set on
    team_members
    for ALL operations which allows users from a team to add other users to their team, providing they are already part of a team (in a function called
    get_teams_for_authenticated_user()
    ). The issue here is that when my trigger on creating a team tries to insert a new team member, that user is not already a member of the team - violating the RLS policy on
    team_members
    , and therefore not creating a new team member. This is my first time putting this kind of logic in the DB instead of writing my own authz layer - so I'm trying to figure out how best to achieve this while learning at the same time, so it's possible my approach is completely wrong - but I am struggling to fit RLS into a multi-tenant style architecture. Any advice appreciated!
    g
    f
    • 3
    • 12
  • How to use generics with Supabase-generated database types?
    c

    cohlar

    01/02/2023, 4:52 AM
    Hi there, Happy new year 🥳 I'm trying to use TypeScript generics based on the types generated by Supabase from the database, but haven't been able to make it work. Here is what I'm trying to do:
    Copy code
    typescript
    type DbTables = Database['public']['Tables'];
    type TableName = keyof DbTables;
    type DbInsert<T extends TableName> = DbTables[T]['Insert'];
    
    async create<T extends TableName>(insertData: DbInsert<T> | DbInsert<T>[], resourceName: T) {
      try {
        const { data, error } = await supabase.from(resourceName).insert(insertData).select();
        if (error) throw error;
        return data;
      } catch (error) {
        console.error(error);
      }
    },
    My generic indexed access operator isn't working as I was hoping... would anyone know how to make this work? -- also posted on github for traceability, with additional details about the tables, types and error message: https://github.com/supabase/supabase/discussions/11398
    d
    t
    • 3
    • 18
  • Creating profile first, then sending invite email after the fact
    l

    LearningJourney

    01/02/2023, 5:50 AM
    Is it possible for me to create profiles without emails inside my app. For some users, I can assign them an email, and a supabase invite will dispatch. The new user will now be linked to the already created profile. Basically not every user in my app will have a login, but all profiles will look the same.
    s
    c
    • 3
    • 13
  • Storage returns assets even after deletion or changing privileges
    i

    ItsEthra

    01/02/2023, 6:01 AM
    Hello, I have a self hosted supabase setup with docker. I am using
    client.from('bucket').download('filename')
    to fetch a file. But after I uploaded the file I changed the policies but I was still able to download the file? Then I deleted a file from a dashboard and even the bucket itself but nothing helped. I tried restarting docker containers but it didn't help either. The function above still returns
    Blob
    data and
    null
    error. What is happening and how do I fix it?
    g
    • 2
    • 5
  • Resource on particular scope Google OAuth and Azure
    l

    Lois

    01/02/2023, 7:39 AM
    Hi team, I was reading this https://supabase.com/docs/learn/auth-deep-dive/auth-google-oauth and found it helpful, but I couldn't find any examples regarding how to add specific scope ex: how to read, write, access user's calendar event and create email. Would be great if anyone can nudge me on any direction? Much appreciated and happy new year!
  • How does supabase handle scaling?
    o

    Oddman

    01/02/2023, 7:58 AM
    I'm looking at Supabase, but... I'm not convinced of its scaling properties. It claims it can do a lot, but nowhere can I find details on how it achieves this, just that it does. How is it handling horizontal or vertical scaling of postgres? When does it decide on this? As an aside, can it handle specifically-timed edge functions as like, background jobs? If not, how could I modify it so I can? Is this even possible?
    f
    • 2
    • 47
  • Refer a friend
    d

    dev Joakim Pedersen

    01/02/2023, 9:10 AM
    Happy new year all! I want to create a refer a friend function on my site. where if you refer a friend you get rewarded 20 points. and if the friend creates an account then the referrer get's 80 more points. I've tried a bit before with magic links but let it rest since I was not able to do it, I was struggling a lot with finding a way to listen if the person creating an account is coming from a magic link. So I wonder if anyone has done something like this system on their site, and could explain me their flow. 1. client john sends a refer a friend request to kate. he then get's returned 20 points on his account. 2. Kate get's the email and get's redirected to create account page. 3. Kate has created an account and john gets 80 additional points to his account.
    s
    • 2
    • 2
  • Authentication Verify API
    r

    Rares | Foton • Teeps

    01/02/2023, 9:47 AM
    hey ... is there an api we could use to manually verify the user from our app? We want to send the confirmation link ... the link points to us (with token) and we call the api to verify the user. The only 2 pieces missing is a token variable for the email and an endpoint to call for the verification
    s
    • 2
    • 4
  • Issue with insert in JavaScript
    a

    akshatgggggg

    01/02/2023, 10:45 AM
    Hi, I'm trying to insert a new row into my table, but I keep getting "undefined" data and error in response while trying to debug the error. There is no record inserted. I tried the same by converting it into Python syntax on my local machine and it worked. Any advice?
    f
    • 2
    • 7
  • Storage exception because jwt expired
    w

    Wizzel

    01/02/2023, 11:11 AM
    I am encountering an error when trying to upload a file to storage:
    Copy code
    StorageException (StorageException(message: jwt expired, statusCode: 400, error: jwt expired))
    even when I refresh the session with
    Copy code
    dart
    await Supabase.instance.client.auth.refreshSession();
    before uploading. Is this a bug or am I missing something?
    j
    • 2
    • 4
  • Help with DB Schema fix RLS
    ł

    ŁukaszW.

    01/02/2023, 11:40 AM
    I am working with a project where using migratiuons to keep db in sync. Lastly my RLS policies are not working. Anon user has full access to the DB. I Have removed all the GRANTS which was added by the pg_diff by the process of changing the schema. I don't know exactly what is wrong in the DB so everyone has access, even simple RLS rule
    Copy code
    CREATE POLICY
        "Enable read access for public only published" ON public.apartments AS PERMISSIVE FOR
    SELECT
        TO anon USING ( (is_visible = true));
    and still anon user can see rows with is_visible set to false. I have applied some schema repairs found on GH issues, but with no luck, Now I set up the pgtap test to check this, and the test fails so anon have access to the row. Any help or direction to go now ?
    • 1
    • 2
  • How do I enable features from Launch Week 6 for existing projects?
    b

    brassotron

    01/02/2023, 1:13 PM
    Hello, I'm just looking through the Launch Week 6 blog posts and want to use some of the features, but they don't seem to appear for me in existing projects? For example, I don't have the Vault UI in settings? Do I need to enable them somewhere? Thanks!
    g
    s
    • 3
    • 4
  • SQL is returning a value and rpc another
    i

    iStun4Fun

    01/02/2023, 1:51 PM
    I've got this on SQL with this query:
    Copy code
    SELECT 'streams' as metric, sum(quantity) as value, label_id
    FROM royalties
    JOIN music_labels
    ON royalties.label_id = music_labels.id
    WHERE music_labels.owner = 'da9c6981-5382-4809-af0f-bc324bbc589a'
    AND royalties.type = 'streaming'
    GROUP BY label_id
    
    UNION ALL
    
    SELECT 'downloads' as metric, sum(quantity) as value, label_id
    FROM royalties
    JOIN music_labels
    ON royalties.label_id = music_labels.id
    WHERE music_labels.owner = 'da9c6981-5382-4809-af0f-bc324bbc589a'
    AND royalties.type = 'download'
    GROUP BY label_id
    
    UNION ALL
    
    SELECT 'total_revenue' as metric, SUM(royalties.total_revenue) as value, label_id
    FROM royalties
    JOIN music_labels
    ON royalties.label_id = music_labels.id
    WHERE music_labels.owner = 'da9c6981-5382-4809-af0f-bc324bbc589a'
    GROUP BY label_id
    
    UNION ALL
    
    SELECT 'artists' as metric, COALESCE(COUNT(artists.name)::numeric, 0) as value, label_id
    FROM artists
    JOIN music_labels
    ON artists.label_id = music_labels.id
    WHERE music_labels.owner = 'da9c6981-5382-4809-af0f-bc324bbc589a'
    OR artists.label_id IS NULL
    GROUP BY label_id
    
    UNION ALL
    
    SELECT 'releases' as metric, COUNT(releases.id) as value, releases.label as label_id
    FROM releases
    JOIN music_labels
    ON releases.label = music_labels.id
    WHERE music_labels.owner = 'da9c6981-5382-4809-af0f-bc324bbc589a'
    GROUP BY releases.label;
    g
    • 2
    • 5
  • Issues accessing auth.users table
    b

    Bazinga

    01/02/2023, 3:30 PM
    Hello, I've a question regarding access to auth.users table. For some reason, after restoring my project from paused state. I was unable to use either sign_in or sign_up methods in both python and flutter. it results in ""Server error '502 Bad Gateway' for url"" In addition, I've tried using the supabase authentication dashboard for recovery pass, magic link and invite but none of them works. it shows failed to fetch Any help would be appreciated :))
    g
    • 2
    • 2
  • Checking user_metadata in RLS
    m

    mrboutte

    01/02/2023, 4:03 PM
    Copy code
    (((jwt() -> 'user_metadata'::text) ->> 'role'::text) = 'admin'::text)
    is this the correct way to check
    user_metadata
    ☝️ I want to verify the user in the jwt has
    user_metadata.role === 'admin'
    g
    u
    • 3
    • 35
  • onAuthStateChange not firing
    s

    Spoonz

    01/02/2023, 4:23 PM
    Hi all, I'm trying to identify when the
    raw_user_meta_data
    column has a field updated by using
    event == 'USER_UPDATED
    but I can't get the state change function to fire with the USER_UPDATED event type at all. I'm running an update on that column from both SQL editor and browser and nothing is detected. It picks up SIGNED_IN events when switching tabs so I'm confident my useEffect hook is correct, does anyone have an example of it working with USER_UPDATED?
    g
    • 2
    • 9
  • Studio contributing infinite load
    x

    xyzz

    01/02/2023, 5:26 PM
    Following the getting started guide I was able to get everything up and running locally, however for studio, all of the sub sections I get an infinite load screen. I saw some other issues on here about logging in and one instance said he just couldnt signin under localhost:8082/signin I get redirected to localhost:8082/projects where there is one default project. When I click on this one none of the subsections load, I assume I need to login locally but do not have a way to do that if localhost:8082/signin redirects right away.
    n
    • 2
    • 4
  • I need some information about data protection
    l

    Liaxum

    01/02/2023, 5:32 PM
    Hi, I'm glad to work with supabase. I'm currently creating a social network app and I need more details to respect the current law in France about data privacy and protection (RGPD). 👍
    n
    • 2
    • 2
  • StorageException - The resource already exists
    d

    DigitalSolomon

    01/02/2023, 6:10 PM
    Hi, New to Supabase here. I'm using the Storage API via Flutter and I'm encountering a
    StorageException
    whenever I attempt overwrite a file.
    StorageException
    error:
    Duplicate
    message:
    The resource already exists
    statusCode:
    409
    I have
    UPDATE
    ,
    SELECT
    , and
    INSERT
    storage policies for public access. What's best way to update an image but keep the same file path? Thanks
    w
    • 2
    • 1
  • Connection refused from my local machine but still working from remote machine
    g

    Gonza

    01/02/2023, 7:00 PM
    I'm connecting to a Supabase database from an AWS machine without issues. I had been also connecting from my local machine without problem until 3 days ago. Since then, all attempts to connect are met with a "Connection refused" error. I've triple checked and the connection strings and passwords are correct, and I can indeed connect to the database from my server, but not from my local machine. I can't figure out what changed since I could connect 3 days ago. I did upgrade to a paid subscription just before the issue started (I was in the free tier before) Any ideas what could be happening?
    s
    • 2
    • 1
  • Using Discord OAuth with Supabase selfhosted
    h

    HayHay

    01/02/2023, 7:01 PM
    Hi there, I'm having trouble using OAuth to sign in when self hosting supabase. When attempting to signin, I get redirected and it tells me
    Copy code
    json
    {"code":400,"msg":"Unsupported provider: provider is not enabled"}
    I've attached the changes I made to the .env file for the docker container, which I'm not 100% sure is right or not Thanks!
  • supbabase ui - change tabs button color
    b

    bro

    01/02/2023, 7:23 PM
    I'm using supabase ui tabs ( https://ui.supabase.io/components/tabs ) This is my code
    Copy code
    <Tabs>
          <Tabs.Panel id="one" label="Tab one">
            Tab one content
          </Tabs.Panel>
          <Tabs.Panel id="two" label="Tab two">
            Tab two content
          </Tabs.Panel>
          <Tabs.Panel id="three" label="Tab three">
            Tab three content
          </Tabs.Panel>
        </Tabs>
    what I'm trying to achieve is to change the
    Tabs
    color to something else other than the default green. anyone knows how to do it?
  • so many roles. I can pick anyone to use?
    a

    Ankur63

    01/02/2023, 7:58 PM
    custom roles are not in supabase. There are ton of roles inside supabase. So, can i use any of these? It wont hamper any functionality of supabase?
    g
    n
    +2
    • 5
    • 7
1...858687...230Latest