https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Problems with sign out
    j

    JBarcelo

    05/06/2023, 3:07 PM
    I am using the auth with the providers and when i use the sign out y get this error.

    https://cdn.discordapp.com/attachments/1104424127856656444/1104424128200581302/Captura.PNG▾

    g
    • 2
    • 7
  • Subdomain auth
    a

    alitnk

    05/06/2023, 3:10 PM
    I'm following this guide to have the user sign in at example.com and redirect to subdomain.example.com with their session, using cookies. https://github.com/orgs/supabase/discussions/5742#discussioncomment-4050444 the issue now, is when user opens the subdomain after a few hours, it sends the reset token and gets the new access token. but then when they visit example.com again, they get this:
    Copy code
    {
      "error": "invalid_grant",
      "error_description": "Invalid Refresh Token: Already Used"
    }
    Wondering if need to do anything to further sync the two auth states... any ideas?
    g
    • 2
    • 7
  • How to get the user created date?
    s

    Shelby

    05/06/2023, 4:34 PM
    Attached image, how do I get that date with the SDK

    https://cdn.discordapp.com/attachments/1104446009272184982/1104446009515458630/image.png▾

    g
    • 2
    • 13
  • Angular universal | Angular SSR
    m

    Mhd Adnan Askar

    05/06/2023, 5:36 PM
    I have a problem with linking Supabase with Angular SSR I installed and created the Supabase service in my application and it's working fine when I run my application using the normal build (ng serve) But when I use the SSR build (ng run [APP-NAME]:serve-ssr) or (npm run dev:ssr): the page or the component that I inject the SupabaseService in doesn't load I have to open a component that I didn't inject the SupabaseService in, then I have to go to the injected Services component using the angular routerlink to make the Injected component with the SupabaseService Work I didn't get any console error or network error when I open the Injected component with SupabaseService directly, but in the network I can see my component request Time = pending and doesn't change
    g
    • 2
    • 14
  • Local Dev, Create new project or DB
    p

    puffybatman

    05/06/2023, 6:00 PM
    i have followed this guide to get local dev using docker up and running: https://supabase.com/docs/guides/getting-started/local-development But i am confused how to create a new project instead using default...
    g
    • 2
    • 2
  • How to use common table expression in a policy
    g

    goldyman

    05/06/2023, 7:15 PM
    Is there a way to use common table expression (CTE) or a view inside declaration of a policy
    g
    • 2
    • 1
  • Suggestions? Free form search
    d

    dmayo2

    05/06/2023, 7:20 PM
    Good Day. I have the following and I'd like to have as robust a search feature as possible. I'm just looking for suggestions as a starting point. table1.name (text) table2.content (text) table3.created_at (timestamptz) table4.tag_name (varchar) Basically their are many
    content
    to one
    name
    . The meta-data is kept in table3 when
    name
    was created, and each
    name
    can have as many `tag_name`s and the user configures. Those are the fields I want to create the search on. I'm using JS library v2. Thanks.
    • 1
    • 1
  • Local edge function fails. Latest cli and Docker images.
    v

    ven

    05/06/2023, 7:31 PM
    I am trying to implement the example here - https://github.com/thorwebdev/edgy-edge-functions/blob/main/supabase/functions/oak-server/index.ts and I get
    Copy code
    Download https://esm.sh/v119/oak@9.0.0/X-ZS8q/esnext/oak.mjs
    Download https://esm.sh/v119/node_process.js
    Download https://esm.sh/v119/commander@2.19.0
    Download https://esm.sh/v119/lodash@4.17.21
    Download https://esm.sh/error.js?type=unsupported-nodejs-builtin-module&name=module&importer=oak
    Download https://esm.sh/v119/path-browserify@1.0.1/esnext/path-browserify.bundle.mjs
    Download https://esm.sh/v119/url@0.11.0/esnext/url.bundle.mjs
    Download https://esm.sh/v119/node_events.js
    Download https://esm.sh/v119/querystring-es3@0.2.1/esnext/querystring-es3.bundle.mjs
    Download https://esm.sh/v119/punycode@2.3.0/esnext/punycode.bundle.mjs
    worker thread panicked Import 'https://esm.sh/error.js?type=unsupported-nodejs-builtin-module&name=module&importer=oak' failed: 500 Internal Server Error
    Error: channel closed
        at async UserWorker.fetch (ext:sb_user_workers/user_workers.js:50:21)
        at async Server.<anonymous> (file:///home/deno/main/index.ts:102:16)
        at async Server.#respond (https://deno.land/std@0.182.0/http/server.ts:220:24)
    failed to send the halt execution signal
    failed to send the halt execution signal

    https://cdn.discordapp.com/attachments/1104490594715308192/1104490594853728287/supabase_error.png▾

  • Not able to deploy edge function
    v

    ven

    05/06/2023, 8:20 PM
    I am not able to deploy a new edge function. Nothing in the remote logs but I get the following error in terminal
    Copy code
    Error: Error bundling function: exit status 1
    file:///src/import_map.json
    file:///src/index.ts
    file:///_services/contactMeService.ts
    file:///_shared/cors.ts
    file:///_shared/types.ts
    file:///types/db_types.ts
    error: Uncaught (in promise) Error: NotFound: The system cannot find the path specified. (os error 3)
          const ret = new Error(getStringFromWasm0(arg0, arg1));
                      ^
        at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:513:19)
        at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1559899)
        at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1398157)
        at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1895031)
        at __wbg_adapter_40 (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:229:6)
        at real (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:213:14)

    https://cdn.discordapp.com/attachments/1104502850131865751/1104502850459013120/remote_logs.png▾

    o
    • 2
    • 2
  • How to empty a bucket via the supabase UI (or even using an sql query)
    h

    Hugos

    05/06/2023, 8:45 PM
    I can only find ways to clear it using the javascript client. How to clear a bucket manually?
    g
    s
    • 3
    • 20
  • Custom Schema did not show autogenerated APIs-what is wrong?
    c

    cartcolombia

    05/06/2023, 9:07 PM
    Hi, Im new in Supabase and I have some tables created in the "public" schema that are working with API... and just created a new custom schema, granted usage and other grants to anon, postgres, authenticated, service_roles, and also added the new schema to API schema in the dashboard API setting page, then created tables inside the new schema, however when I click <>API an error message appears "Application error: a client-side exception has occurred (see the browser console for more information).".... Also inside the new custom schema I created a table with the same name of existing table in "public" but with different column names and then clicked <>API for this table, and this time the API documentation appears with no error but noticed that the shown APIs are exactly the same of the "public" schema table not the custom schema :(..... would you help me?
    g
    • 2
    • 22
  • Sign In for cloudflare
    h

    Hexye

    05/06/2023, 10:49 PM
    When trying to install logflare on cloudflare I login into logflare and then I press authorize to read and write on cloudflare and it redirects me to a non existing page
  • PostGIS functions in JavaScript library
    n

    Nin

    05/06/2023, 11:54 PM
    I'm looking to execute this function using the JavaScript library and wonder whether I'm asking for the impossible: SELECT * FROM grid WHERE ST_DWithin(coordinates, 'POINT(5 5)', 1); My alternative is connecting my Edge function directly to the db
    g
    • 2
    • 8
  • edge functions not working! downloaded latest images and latest cli.
    v

    ven

    05/07/2023, 12:32 AM
    Copy code
    Setting up Edge Functions runtime...
    v1.2.18: Pulling from supabase/edge-runtime
    26c5c85e47da: Pull complete
    3b5266c51eeb: Pull complete
    ea9f73b5bab7: Pull complete
    Digest: sha256:8ceef4bcbb1f7b437eb9522e8d5df9ca9d1f05922181baf4f97bf86ecfaa7419
    Status: Downloaded newer image for public.ecr.aws/supabase/edge-runtime:v1.2.18
    Serving functions on http://localhost:19741/functions/v1/<function-name>
    serving the request with /home/deno/functions/slack
    Listening on http://localhost:9999/
    TypeError: Invalid URL: ''
        at getSerialization (ext:deno_url/00_url.js:74:11)
        at opUrlParse (ext:deno_url/00_url.js:65:10)
        at new URL (ext:deno_url/00_url.js:368:27)
        at new Request (ext:deno_fetch/23_request.js:323:25)
        at ext:deno_fetch/26_fetch.js:418:27
        at new Promise (<anonymous>)
        at fetch (ext:deno_fetch/26_fetch.js:414:18)
        at Server.<anonymous> (file:///home/deno/functions/slack/index.ts:39:18)
        at async Server.#respond (https://deno.land/std@0.186.0/http/server.ts:220:24)
    s
    • 2
    • 36
  • Updating user's email, without confirming the previous email.
    a

    Ar

    05/07/2023, 2:02 AM
    Hello Everyone, I have stumbled across this scenario: My user signs up with phone OTP. I show them their profile which has their email and first name and they update it. Because it is their first time, confirmation/change link is sent to their email. But, what if they inputted the wrong email, and they want to send it to another. They simply cant. Calling updateUser again will throw this error:
    Copy code
    {
      "code": "23505",
      "message": "duplicate key value violates unique constraint \"identities_pkey\"",
      "detail": "Key (provider, id)=(email, 64d7ef47-92f7-406f-9857-06854101f887) already exists."
    }
    Which makes sense as updateUser with email will try to create a new identity, because the user's email field is empty. but there is already one even though it is not confirmed.
    j
    • 2
    • 9
  • rpc store proc call returns true but sql editor function call returns false
    t

    Tin

    05/07/2023, 3:57 AM
    Hello, I have tried my best to figure out why I am getting true values being return in my rpc call while querying the function manually returns me the correct value. Here is function call in the code
    Copy code
    async function checkEmailIsAvailable(email: string) {
        const { data, error } = await supabase.rpc("f_is_email_available", {
          _email: email,
        });
        console.log("email", data);
        console.log("email:", error)
       }
    and here is the script
    Copy code
    create or replace function f_is_email_available(_email text)
    returns boolean as
    $$
    begin
      return not exists (select 1 from profiles p where p.email ILIKE _email);
    end;
    $$
    language plpgsql
    Regardless of what value i pass in via using rpc, i always get true while calling the function in sql editor, it returns the correct boolean value. I feel like it is something very simple but I am just overlooking it. Thank you much in advance.
    g
    • 2
    • 2
  • How to clean up all assets upload by one user?
    c

    codedao

    05/07/2023, 5:41 AM
    We have some spam users that upload a lot of objects into our storage. We can easily run a SQL to delete his data in
    public
    and
    storage
    schema. But the uploaded objects are still there. Is there a script to delete/clear them?
    g
    • 2
    • 3
  • IPv6 connection
    e

    ef

    05/07/2023, 6:19 AM
    I've got a machine on Vultr's $2.5 plan which doesn't allow ipv4 connections out. I'm trying to connect to supabase's postgresql server via the postgresql command line tool as well as the go sql libraries. I'm unable to connect and can only connect if I use ipv4. Are there plans to support ipv6?
  • How to setup Prisma Client with session token coming from the Supabase Auth login?
    m

    Madz

    05/07/2023, 8:25 AM
    I'm trying to create a Prisma Client for the CRUD functionality but hit a roadblock abut the authorization. Is it possible to bearer auth token in prisma client?
    n
    j
    • 3
    • 6
  • How to make a public storage bucket readonly?
    w

    Wizzel

    05/07/2023, 8:52 AM
    I have found this example
    Copy code
    sql
    -- 1. Allow public access to any files in the "public" bucket
    create policy "Public Access"
    on storage.objects for select
    using ( bucket_id = 'public' );
    but I don't quite understand how this is different from a bucket that is set to "Public" from the UI.
    g
    • 2
    • 7
  • Stream to Add, Deletes
    p

    Philipp_Nut

    05/07/2023, 9:30 AM
    I build the current stream. Then I am doing asyncMap, to load the data. And yield* it as a StreamProvider. On my Page I am making watch to the stream and then rendering on when. On the first startup it is working. When i now add an item to this table and then go on the screen again it is not updating there ist still the old data.

    https://cdn.discordapp.com/attachments/1104701769113682001/1104701769776365618/image.png▾

    • 1
    • 2
  • Unable to enable apple provider for PKCE flow
    u

    0xAsimetriq

    05/07/2023, 10:21 AM
    Hey everyone, I am following this blogpost about PKCE sign in flows that can be used for apple now https://supabase.com/blog/supabase-auth-sso-pkce#migrating-to-pkce-on-the-server and under
    Native Apple login on iOS
    section it states that the only requirement to enable this is to provide "iOS bunlde id". However, it seems that as of now, supabase's dashboard does not account for this as it throws an error uppon saving asking to fill out all other fields.
    q
    • 2
    • 1
  • Difference between raw_app_meta_data and raw_user_meta_data when creating custom claims
    l

    Logaritma26

    05/07/2023, 10:59 AM
    What is the difference between these two, im trying to implement a custom user segmentation solution, the examples in https://github.com/supabase-community/supabase-custom-claims used
    raw_app_meta_data
    but there is a similar field called
    raw_user_meta_data
    I wonder whats the difference and what can raw_user_meta_data be used for
    n
    • 2
    • 5
  • Which payment gateway do you use ?
    p

    Philipp_Nut

    05/07/2023, 1:03 PM
    I want a gateway, which supports PayPal, CreditCart, Google Pay and Apple Pay. I looked at Stripe but there is no PayPal. When I tried paypal it is not compatible with the latest Supabase version
    s
    • 2
    • 2
  • Does getPublicUrl() supports transformation
    r

    Revaycolizer

    05/07/2023, 1:07 PM
    As i want to enable transformation in this function as it throws an error stating that "url" parameter is valid but upstream response is invalid
    Copy code
    const fetchPosts=useCallback(async()=>{
        const { data:files } = await supabase
        .storage
        .from('files')
        .list()
    
        if(files && files.length>0){
          const promises = files.map(async(file)=>{
            const post = supabase.storage.from('files').getPublicUrl(file.name, {
              transform: {
                width: 500,
                height: 600,
              },
              })
            return post.data
          })
          const posts = await Promise.all(promises)
          setDownload(posts)
        }
      
      },[])
    n
    • 2
    • 21
  • how to query the supabase psql by order
    b

    Biki

    05/07/2023, 2:25 PM
    below is the schema, like i wan to get the feedback with the most upvotes and leastupvotes how to do it? Feedback id xxxxxxxxx title xxxxxxxx description xxxxxxxxx User id * email ** Upvote userId ** feedbackid *
    n
    • 2
    • 3
  • Why does a fetch that includes a foreign table return the content as an array *or* a single?
    o

    ola berglund

    05/07/2023, 2:28 PM
    It is quite infuriating to handle the response in code.

    https://cdn.discordapp.com/attachments/1104776665340596366/1104776665625800714/either.png▾

    • 1
    • 2
  • Business logic in DB functions or on keep on the client?
    r

    rafael

    05/07/2023, 3:01 PM
    hey guys, what do you guys usually do? Do you guys keep the business logic in DB functions and use RPC to return what you need, or keep the business logic in the mobile client and query the database? I'm just curious because I'm not sure what is worth it, keep all logic in the client or keep all logic in DB functions using plv8 etc? Thanks 😉
    h
    v
    • 3
    • 4
  • Edge functions that are triggered on database events
    y

    Yuu

    05/07/2023, 3:28 PM
    I want to trigger functions on database events, similar to firebase cloud functions. This specific function is to randomly generate a user's avatar when they signup. I handle user profiles like
    Copy code
    sql
    CREATE OR REPLACE FUNCTION public.handle_new_user()
     RETURNS trigger
     LANGUAGE plpgsql
     SECURITY DEFINER
     SET search_path TO 'public'
    AS $function$
    begin
      insert into public.profiles (id)
      values (new.id);
      return new;
    end;
    $function$;
    
    CREATE TRIGGER on_auth_user_created AFTER INSERT ON auth.users FOR EACH ROW EXECUTE FUNCTION handle_new_user();
    When this row is inserted, I want to make a call to dicebear, generate an avatar, upload it to storage and set the url to
    profile.avatar
    . Of course, the user will be given an option to change it during the onboarding process so I don't want to put it after the onboarding (if they haven't selected one)
    g
    v
    • 3
    • 5
  • Database egress size
    m

    mikel

    05/07/2023, 4:19 PM
    Hey there, I have a JSONB cell in my table that contains analytics data (so it can be very long and heavy cell). I made a custom data to check what can be the KB size of the cell. I pasted the data inside the Supabase cell and in a JSON validator online to check the size. The online json validator said the size was 2.7KB. Then I made an sql function that gives me the cell size and it showed me 670 bytes. When I make an api request for that cell using node.js, will the database egress (for the billing) will be 670 bytes to 2.7kb? Thanks for reading 🙏🏻
    g
    • 2
    • 2
1...204205206...230Latest