https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • I need the magic link to use the same tab as the one used to enter the email.
    p

    pele'sghost

    05/12/2023, 2:16 AM
    This is my code: `const { data, error } = await supabase.auth.signInWithOtp({ email, options: { emailRedirectTo:
    ${window.location.origin}/home
    , target: '_self' }});` it opens a new tab .
    g
    • 2
    • 1
  • Python Supabase Google OAuth
    k

    kal

    05/12/2023, 4:12 AM
    Hi, I'm looking if someone can post a working example that they have of their python oauth with google. I can log in and authenticate successfully with google oauth fine, but it doesn't look like it's storing my session, and I'm unable to control the redirect_to uri it seems. I have printed out the response after I logged in and I can see that I have the access_token and other information, but it seems that supabase isn't detecting this and I'm not sure where I save the access_token to tell supabase to remember them, even though it creates their account in the database, and I can see a cookie created on the client side. *Side note: I'm also wondering if I even need app.get('/callback')... Since supabase should handle that for me, right? This is the error I receive when trying to run supabase.auth.get_user, and I've tried passing in the token to it, but no luck. File "C:\Users\name\AppData\Local\Programs\Python\Python310\lib\site-packages\gotrue\_sync\gotrue_client.py", line 378, in get_user return self._request("GET", "user", jwt=jwt, xform=parse_user_response) File "C:\Users\name\AppData\Local\Programs\Python\Python310\lib\site-packages\gotrue\_sync\gotrue_base_api.py", line 118, in _request raise handle_exception(e) gotrue.errors.AuthApiError: invalid claim: missing sub claim My code is in the message below, please let me know what I might be doing wrong, or if you have auth tokens through google oauth saving properly in your python project please share an example!
    • 1
    • 1
  • Finding Supabase Cloud PostgREST version
    r

    Robin's Donuts

    05/12/2023, 5:46 AM
    Hi - I can't seem to find what version of PostgREST is running in our Supabase cloud instance. Is it possible to find this?
    t
    g
    • 3
    • 4
  • Supabase supported managed DB's
    t

    tspvivek

    05/12/2023, 6:01 AM
    Which managed DB has full support for supabase?
    g
    v
    b
    • 4
    • 6
  • Getting AuthRetryableFetchError for particular group of users
    g

    greentfrapp

    05/12/2023, 7:12 AM
    Hey team! We recently migrated to using Magic Link / OTP for log in. But just discovered that most (if not all) of our users who are using "XX@qq.com" are unable to log in. The error we are seeing is "AuthRetryableFetchError: Failed to fetch", In addition, one of our users seems to be able to log in successfully after switching to a VPN. FYI, most users with "XX@qq.com" emails are likely based in China. Is this a documented issue regarding China-based users? And is there a workaround aside from using a VPN? Thanks!
    g
    • 2
    • 1
  • Casting a number from a javascript object, what datatype to cast into RPC?
    j

    jfbn

    05/12/2023, 7:41 AM
    I am trying to invoke a RPC function like so:
    Copy code
    js
    const res = await supabaseClient.rpc('set_preferred_club', {
         club_id: selectedClub.id
    });
    club_id
    is just a number, not a uuid. in my `clubs`table the column is a ìnt8` My RPC definition looks like this:
    Copy code
    sql
    
    begin
      UPDATE public.profiles
      SET primary_club = club_id
      WHERE profiles.user_id === auth.uid();
    end
    What should the argument type for my RPC be? Numeric? Int8? And how am I supposed to know? When invoking the function I receive this error message and hint:
    Copy code
    "No operator matches the given name and argument types. You might need to add explicit type casts."
    
    hint: "operator does not exist: uuid === uuid"
    • 1
    • 1
  • Supabase Storage does not support filenames with Japanese characters?
    k

    KoBaGo

    05/12/2023, 8:03 AM
    Nice to meet you guys! When I tried to upload a file with Japanese characters in the name to Supabase Storage from
    supabase-js
    , I got this error:
    Copy code
    message: 'The object name contains invalid c
    characters'
    So, Supabase Storage doesn't support names with Japanese in them? then I want documentation about supported characters.
    g
    • 2
    • 3
  • Can't download files from Supabase Storage
    s

    Solias

    05/12/2023, 9:13 AM
    I'm trying to download a bunch of files from supabase storage but it just goes into an infinite spinner. Even if I download 1 file, it just says "failed to download xyz.png" Why? This is super urgent, as I need access to these files locally fast.
    g
    • 2
    • 4
  • Many-level relations in tables, how to write policies?
    t

    TheRien

    05/12/2023, 9:28 AM
    I have quite a few tables in my database that all relate to each other one way or another. For the purpose of this question let's keep it to: - Organizations - Teams - Users So organizations exist of multiple teams and teams exist of multiple users. On teams I have the following policy:
    Copy code
    CREATE POLICY "see_only_own_teams"
    ON public.teams
    FOR SELECT USING (
      auth.uid() = user_id
    );
    I don't have any policies on organizations currently. In fact, I don't want people to query organizations directly. I just want to do
    Copy code
    supabase.from('teams').select('name, organizations (name)')
    If I use this query currently, I will get an array of teams, but they will have an empty property organizations. How can I make this property be populated?
    v
    g
    b
    • 4
    • 25
  • Applying many conditional filters(including foreign tables) at once doesnt work
    z

    Ziga

    05/12/2023, 9:37 AM
    Hello, I have issues with getting data(posts) when trying to apply multiple filters at once. Example: I am conditionally checking for filters and applying them if they are active. In this case company and job_categories_posts are foreign tables. I am using !inner in select to actually filter them which is working fine. But whenever i want to apply 2 filters at once, for example adding Categories to Query, I won't get back any data. I was also trying to create this with or operator but with no luck. Can someone please directs me into the right direction here and maybe provide a code solution for this example? PS: I am not the best at postgres
    Copy code
    ts
     if (Query) {
       query = query.filter('company.name', 'ilike', `%${Query}%`)
       query = query.ilike("title", `%${Query}%`)
     }
    
     if (Regions) {
       const regions = (Regions as string).split(',')
       query = query.in("region", regions)
     }
    
     if (Categories) {
       const categories = (Categories as string).split(',')
       query = query.in("job_categories_posts.job_category.id", categories)
    }
    g
    • 2
    • 10
  • Insert as authenticated user in to table as RLS
    l

    Le_frog

    05/12/2023, 10:18 AM
    Good day , I am trying to insert from javascript API to a table with RLS. I have the policy on the table. See attached. Then trying const { data, error } = await supabase .from('assist') .insert( { approve_leader_id: null, approved: 0, assist_amount: req.body.session_data.assist_amount, assist_header: req.body.session_data.assist_header, assist_text: req.body.session_data.assist_text, completed: 0, user_id: req.body.session_data.user_id }) Getting error : { code: '42501', details: null, hint: null, message: 'new row violates row-level security policy for table "assist"' } What am I missing. The table has read policy to public so it cant be the return select that could be happening in the background. Is there a way to add something like this to the api call. .headers({ Authorization:
    Bearer ${req.body.access_token}
    , Prefer:
    user_id=${req.body.user_id}
    }); please help

    https://cdn.discordapp.com/attachments/1106525847839576094/1106525848015732867/image.png▾

    n
    a
    • 3
    • 7
  • phone authentication
    a

    AMZ7860

    05/12/2023, 12:20 PM
    hello, like firebase we dont need any extra provider like twalio and all, twalio is so expensive for indian users, now appwrite lunches its cloud and there they support there own provider to send otp messages, in supabase we need extra provider to link or is there any plan in future to support supabase phone otp verification like firebase or appwrite cloud?
  • Local query statement logging in dev env, anyone know how to do this?
    k

    kouwasi

    05/12/2023, 12:24 PM
    For the debugging, can i see query log? like full stack ORMs (e.g. Prisma, ActiveRecord)
    u
    • 2
    • 6
  • Issue uploading using Uppy w/ Tus protocol
    d

    Dilly

    05/12/2023, 1:06 PM
    I got early access to the new Supabase storage features, which includes using the Tus protocol for resumable uploads. I'm using Uppy, and I've configured it to upload in both XHR mode and in Tus mode. XHR mode works flawlessly, but Tus mode seems to have some issues and I'm not sure what the problem is. I understand this is early access, so I just want to report what my experience as it may prove to be helpful as you continue development of this feature. So as I said, I'm using Uppy and I followed the Supabase guide [here](https://supabase.com/blog/storage-v3-resumable-uploads). It works, but only sometimes. I have a control that looks like my first attachment where I can drag a file to and it automatically uploads it to a bucket. This seems to work about 30% of the time. I noticed that when it does work, I see different output in my Network tab in Inspector. However, even if it doesn't work it seems to think it does. I pasted a screenshot of the discrepancy in the output. You can see that when it doesn't work, it sends a request a HEAD request to the resumable endpoint, but it never sends the POST request. However, Uppy still tells me the upload was successful and not failed in the result. I suppose the issue could be with Uppy as well. I'm not really sure what the problem is, I just want to report it. I will use the XHR protocol until I can find a solution to this.

    https://cdn.discordapp.com/attachments/1106568012103954463/1106568012615663626/image.png▾

    https://cdn.discordapp.com/attachments/1106568012103954463/1106568012951203993/image.png▾

  • trying to use supabase terminal on windows
    f

    formigueiro

    05/12/2023, 1:36 PM
    im getting after installation
    bash: supabase: command not found
    boht in bash and windows terminal
    • 1
    • 1
  • How to import a 9GB SQL dump of a DB?
    v

    venk

    05/12/2023, 1:38 PM
    Pretty new to Supabase. I am looking to move my DB from DigitalOcean to Supabase. I have tried using psql on a CLI to import the SQL dump, but it kept erroring out. Any better way to import a 9-10GB postgres dump into Supabase?
    g
    • 2
    • 3
  • deleting rows in `auth.users` via python sdk
    t

    towc

    05/12/2023, 2:08 PM
    Is there a way to do this? Using the python sdk I set the
    ClientOptions
    with a
    schema='auth'
    , and `grant`ed the
    service_role
    all permissions on all tables in
    auth
    , but when I
    execute()
    the
    delete
    query, PostgREST tells me
    auth
    is not one of the available schemas. Going to "Exposed schemas" in
    https://app.supabase.com/project/<project>/settings/api
    , the
    auth
    schema doesn't show up as an option. Can I get around that? It seems a bit unnecessary. The most sensible alternative I could find is triggering an sql function: https://stackoverflow.com/questions/75347170/supabase-delete-user-through-application , but this effectively allows arbitrarily messing with the
    auth
    schema, so I don't see why I shouldn't be allowed to do this directly via the SDK. The use-case is allowing users to delete their accounts by pressing a button, without human intervention
    g
    • 2
    • 5
  • Supabase-js, Lambda and node-gyp-build issues
    t

    tkadlec

    05/12/2023, 2:08 PM
    I'm trying to use the supabase-js module in a Lambda, but it's throwing an error because of an underlying dependency on node-gyp-build. npm ERR! command sh -c -- node-gyp-build npm ERR! sh: node-gyp-build: command not found Has anyone bumped into this? Is there a solution?
    o
    • 2
    • 1
  • Failed to run sql query: there is no unique constraint matching given keys for referenced table "use
    f

    formigueiro

    05/12/2023, 2:16 PM
    Im getting
    Failed to run sql query: there is no unique constraint matching given keys for referenced table "users"
    when im try to create this table linking with auth users

    https://cdn.discordapp.com/attachments/1106585757776359494/1106585757965099058/image.png▾

    g
    • 2
    • 22
  • pushing DB migrations to PROD through github actions errors out
    v

    ven

    05/12/2023, 3:34 PM
    Here is the error message
    Copy code
    Error: supabase_migrations.schema_migrations table conflicts with the contents of supabase/migrations.; Expected version 20230503161039 but found migration 20230512150444_initial_schema.sql at index 0.
    i even tried starting fresh with a db reset including flushing out the schema_migrations table of any records and the tried but still no luck here is how i am generating my initial schema migration file.
    Copy code
    supabase db diff --use-migra -f initial_schema
    • 1
    • 1
  • Next.js and Expo session server auth
    b

    Brayan Obispo Torres

    05/12/2023, 4:04 PM
    Hey folks, Is there a way to use something equivalent to
    createBrowserSupabaseClient()
    with Next.js and Expo, so that when a request is made to the Next.js server, cookies are automatically sent in the headers and the session can be accessed on the server with
    supabaseServerClient
    ?
  • Just FYI: your realtime extensions page has duplicated content
    t

    timconnors

    05/12/2023, 4:33 PM
    check it out: https://supabase.com/docs/guides/realtime/extensions
    o
    • 2
    • 1
  • Svelte store data from Supabase
    t

    TitusTetricus

    05/12/2023, 5:42 PM
    Hi All, Pretty new to Supabase and I am running into an issue trying to put data from Supabase into a Svelte store. I have a table calles user_projects in Supabase, and I'd like to keep these in the store to access throughout my app. I am missing something with the types here, and can't seem to figure it out. If I define the store as just a writable array I get the error "The type "null" is not assignable to the type never[]". In the past I have fixed that by setting the setting the type of the writable array in the store like below:
    export const userProjects: Writable<UserProject[]> = writable([]);
    However that then is giving me issues when trying to set the store to the array. The error is long, but it's missing all the Row, Update, Insert, etc. that is defined from the types generated by Supabase CLI. Are there any docs, or examples online, I haven't found showing how to handle getting Supabase data into the store like this?
    j
    • 2
    • 1
  • Prevent logout on singup
    i

    ItZSoul

    05/12/2023, 6:43 PM
    I have an admin panel, who can create users, but when the admin creates a user with the singup method, it automatically logs out too. ¿Any way to prevent this? PD: I don't want to use the service_role, since this administrator is administrator over only a certain part of the application. For example a school principal can create students, but he can create students for his school and not for others. Thank you.
    g
    • 2
    • 11
  • Using a custom OAuth provider
    d

    DannyDanDan

    05/12/2023, 7:26 PM
    Hi! I'm working on a website for a client i started a while ago and wanted to try migrating to Supabase, but there doesnt seem to be a custom oauth provider, which i need for a Dutch school authentication service (Kennisnet Entree). How can i add this to Supabase auth?
    g
    • 2
    • 4
  • CI fails tests after upgrade of Supabase. Localhost works. Schema not exposed properly?
    t

    timm

    05/12/2023, 7:29 PM
    After upgrading Supabase from v.1.45.2 to v1.57.7, my CI lint output is different & test setup started failing (in relation to non-public schemas). I suspect it's a configuration issue around schemas, as the lint output is now different on CI vs locally: Localhost
    Copy code
    ▶ supabase db lint --level warning
    Linting schema: basejump
    Linting schema: nango
    Linting schema: public
    
    No schema errors found
    On CI:
    Copy code
    Run set -e
      set -e
      supabase db lint --level warning
      shell: /usr/bin/bash -e {0}
      env:
        SUPABASE_INTERNAL_IMAGE_REGISTRY: ghcr.io
    Linting schema: public
    
    No schema errors found
    What could be causing this? * Supabase v1.57.7 in use locally + on CI. * The Github action runs with supabase/setup-cli@v1.1.5. Reverting back to v.1.45.2 makes CI work again, but I'm dependant on newer features :/
  • Question About Using Supabase With SSR
    m

    Mhd Adnan Askar

    05/12/2023, 7:37 PM
    every one know how SSR works I want to render my page on SSR application (Angular SSR) with data stored in (Supabase tables) the display the page but when I open the page that I request the data from Supabase I got a problem the problem is : the component request still "pending" and doesn't open
    o
    • 2
    • 1
  • SMTP issues
    k

    KiwiHour

    05/12/2023, 8:03 PM
    The emails sent by supabase take a few minutes to send, so I wanted to switch to my own server I tried using nodemailer to set it up, but I get
    Unable to process request
    error when trying to request an email. I usually use gmail API, is there a way to set this up with supabase?

    https://cdn.discordapp.com/attachments/1106673041070628874/1106673581691261028/image.png▾

    https://cdn.discordapp.com/attachments/1106673041070628874/1106673581934522470/image.png▾

    g
    • 2
    • 1
  • How to generate email confirmation, password reset, etc links without sending an email
    k

    KiwiHour

    05/12/2023, 8:44 PM
    I would like to be able to generate a confirmation link without actually sending an email. It seems the only unique part of the urls is the token https://.supabase.o/auth/v1/verify?token=&type=signup&redirect_to= Is there a way I can generate a token like this for a user in my server/back end?
    g
    • 2
    • 15
  • change some data from edge function
    f

    formigueiro

    05/12/2023, 8:51 PM
    i created a simples edge function file slugfy that i wnat to slugfy in the future some data from some register```js import { serve } from "https://deno.land/std@0.168.0/http/server.ts" import { slugify } from "https://deno.land/x/slugify/mod.ts" console.log("Hello from Functions!") serve(async (req) => { // const { name } = await req.json() const slug = await slugify('some string') const data = { message: slug } return new Response( JSON.stringify(data), { headers: { "Content-Type": "application/json" } }, ) })``` is it possible to edit some register in the datble using edge fuction?

    https://cdn.discordapp.com/attachments/1106684978076598332/1106697913654067220/image.png▾

    • 1
    • 1
1...211212213...230Latest