https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Azure OAuth - Error getting user email
    b

    bennettcolecohen

    04/24/2023, 8:34 PM
    Hi there, I've seen this error a few times but none of the solutions solved it for me. I've set up my AD account and linked it to Supabase, however I keep getting "error=server_error&error_description=Error+getting+user+email+from+external+provider" in my URL (appended to the redirected route) Is this related to SSO?
    Copy code
    const { data, error } = await supabase.auth.signInWithOAuth({
                provider: 'azure',
                options: {
                    scopes: 'email',
                    redirectTo: 'http://localhost:5173/welcome'
                }
            });
    g
    s
    j
    • 4
    • 18
  • Subqueries to lookup table in RLS
    k

    kpradel

    04/24/2023, 8:53 PM
    I am trying to only return items in a SELECT clause that can be found in a lookup table. I wasn't able to find any answers in the docs. I edited the policy in the dashboard to include the following but I get a "error near select". select projectid from public.projects_users where userid = auth.uid() Thanks for you r help. Kai

    https://cdn.discordapp.com/attachments/1100162648869449770/1100162649381142578/image.png▾

    https://cdn.discordapp.com/attachments/1100162648869449770/1100162649599254588/image.png▾

    v
    • 2
    • 3
  • NSFW filter on upload
    p

    PTS

    04/24/2023, 9:34 PM
    hey so I came across this: https://twitter.com/Jaaneek/status/1650594370477760540 and now all I think about is nsfw filter on upload. so is there any way to like filter the images we're uploading to our storages? or should we implement some sort of middleware with computer vision to recognize nudity? ngl I wouldn't want somebody in my app to set up their impressive D pic as a profile picture lmao
    b
    • 2
    • 3
  • Deploying studio with Dockerfile
    a

    Apollo

    04/24/2023, 10:18 PM
    Does anyone have a way to override the env variables using a Dockerfile and fly io. I have tried a ton of different things
  • Duplicates in realtime stream
    e

    elliott

    04/24/2023, 10:22 PM
    It appears that some % of the time right now supabase is returning duplicate entries in realtime streams. I have followed this tutorial exactly, and see this behavior: https://supabase.com/blog/flutter-tutorial-building-a-chat-app Is this known? This is a big bug in realtime!!
  • Does anyone have a working example of Supabase Auth UI in the Next.js /app directory?
    u

    매튜

    04/24/2023, 10:54 PM
    I have been running into multiple puzzling errors trying to get this to work, any examples would be appreciated!
    s
    • 2
    • 2
  • email sign up + data
    h

    HE4TED

    04/24/2023, 11:23 PM
    Hello everyone, I am working on a sign-up process where users will provide their email and a string in a separate form page. After they submit the form, I want to send them an email and redirect them to a page where they can set their password. What is the best way to achieve this? Should I link a profiles table with the authentication user? I have tried using the signInWithOtp method, but I am encountering difficulties passing the desired string to be saved with the user. (javascript)
    m
    • 2
    • 1
  • Is the Edge Runtime example missing a dependency?
    e

    eth

    04/25/2023, 12:09 AM
    The self hosted edge function runtime has an example of verifying a JWT. It uses the
    jose
    dependency to verify it. https://github.com/supabase/self-hosted-edge-functions-demo/blob/main/functions/main/index.ts#L24 However, I don't see:
    Copy code
    import * as jose from 'https://deno.land/x/jose@v4.14.1/index.ts'
    As a dependency. Is that missing in this example?
    j
    • 2
    • 2
  • Auth API?
    w

    wiverson

    04/25/2023, 12:44 AM
    I'm trying to implement the native Sign in with Apple feature via C# and Unity. So far I'm having luck getting the native code working, as well as Sign in with Apple via the web SDK. I'm trying to hit the API now to validate the token, but I'm getting a 404 error. I think this is more or less what the query should look like, but I'm getting a 404. Any thoughts on how this is supposed to work? Right now I'm just trying to reverse engineer from the Dart client implementation... POST https://fvkoppwyozwgkiowmcrg.supabase.co/token?grant_type=id_token Accept: application/json apiKey: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ2a29wcHd5b3p3Z2tpb3dtY3JnIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc0Mjc1MTMsImV4cCI6MTk4MzAwMzUxM30.xvDFAjE8pFO2uGxezEdCkuqw5iHNH1XeInhgMPPYr9U Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZ2a29wcHd5b3p3Z2tpb3dtY3JnIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc0Mjc1MTMsImV4cCI6MTk4MzAwMzUxM30.xvDFAjE8pFO2uGxezEdCkuqw5iHNH1XeInhgMPPYr9U { "provider": "apple", "id_token": "idtoken", "nonce": "nonce" }
    g
    • 2
    • 1
  • tshooting: pythonanywhere django connection refusedrefused
    s

    shane0

    04/25/2023, 3:26 AM
    hi, anyone seen this before? I have a django app running it locally I connected to postgres & ran migrate, tables created + admin crud works, but when I push the app to my host pythonanywhere I get a connection refused error
    j
    • 2
    • 1
  • Supabase-js version error on 'supabase functions serve' execution
    j

    J1PHILLI

    04/25/2023, 4:20 AM
    This error appears to be related to the version difference between what is pulled when serving my function locally and what I must be using locally. I can't find any info on how to update the version that is being pulled. Things I've tried I brought the stack down and up hoping it would pull latest on next serve. I made sure I was on the latest supabase CLI. I ran yarn in dev environment. I really don't know though I am new to javascript and supabase all together. Any help is appreciated.
    Copy code
    error: TS2322 [ERROR]: Type 'import("https://esm.sh/v117/@supabase/supabase-js@2.15.0/dist/module/SupabaseClient.d.ts").default<any, "public", any>' is not assignable to type 'import("https://esm.sh/v117/@supabase/supabase-js@2.21.0/dist/module/SupabaseClient.d.ts").default<any, "public", any>'.
      Property 'supabaseUrl' is protected but type 'SupabaseClient<Database, SchemaName, Schema>' is not a class derived from 'SupabaseClient<Database, SchemaName, Schema>'.
        client,
        ~~~~~~
        at file:///home/deno/functions/aifetcher/index.ts:34:5
    
        The expected type comes from property 'client' which is declared here on type 'SupabaseLibArgs'
            client: SupabaseClient;
            ~~~~~~
            at https://esm.sh/v117/langchain@0.0.52/dist/retrievers/supabase.d.ts:7:5

    https://cdn.discordapp.com/attachments/1100275023190708254/1100275023375245382/CleanShot_2023-04-24_at_22.11.05.png▾

  • get user discord I'd when user sign in with supabase
    w

    WALTERB

    04/25/2023, 5:05 AM
    I am trying to get discord user id of the person that log in with their discord however i can only get their full name Can anyone teach me how to get the discord userid of the user that login? I have tried this: const discordId = user.id (this is getting the user id of supabase) MY HTML:
    Copy code
    <div class="navbar">
        <button id="signed" onclick="signin()">Sign in with discord</button>
        <button id="out" class="right" onclick="signout()">Sign out with discord</button>
      </div>
      <p id="name">Not logged in!</p>
    MY JS:
    Copy code
    const _supabase = supabase.createClient(supabaseUrl, supabaseKey)
    
           async function signin() {
          const {data, error} = await _supabase.auth.signInWithOAuth({
            provider: 'discord',
          })
    
          checking()
        }
    
        async function getName() {
          
          const {data: {user}} = await _supabase.auth.getUser()
      const fullName = user.user_metadata.full_name
          
          
      document.getElementById('name').textContent = `${fullName} `
          checking()
        }
    
        getName()
    
        async function signout() {
          const {error} = await _supabase.auth.signOut()
          document.getElementById('name').textContent = "Not logged in!"
          alert("Signed out!")
          checking()
        }
    t
    • 2
    • 1
  • Constantly getting 'column does not exist' in SQL editor
    g

    guidsen

    04/25/2023, 6:33 AM
    Omg never mind - it's really because of the " instead of '
    • 1
    • 1
  • supabase works with Neon.tech database?
    f

    fabio

    04/25/2023, 8:27 AM
    Hello all, I'm new to supabase and the whole serverless shizzle hype I'm seeing a lot now. I'm currently kind of settled with Neon.tech as postgres database platform and wondering if this is compatible with supabase? I see SB supports postgres but also the neontech type of postgres? What about all the cool features I see in supabase like Realtime updates etc...? Is all of that stuff also supported on neontech? Anybody who can confirm or know if it's on a roadmap coming soon or some other status? I'm planning out my next project and want to be sure I'm building on something stable. Thanks all! Also big shout out to the creators of supabase 👋🙏. My 15 minutes playing around with this platform is just amazing. It keeps drawing me back for more so that is a very good thing.
  • Help Supabase auth and refresh tokens (NextJS)
    j

    j3llybeans

    04/25/2023, 8:40 AM
    I'm using supabase auth for a spotify web app. Just noticed that the auth doesn't automatically refresh expired tokens, so i googled a bit but couldn't find much. Played around with the supabase client from
    const [supabaseClient] = useState(() => createBrowserSupabaseClient())
    (from
    _app.tsx
    ), and i found a method called
    supabaseClient.auth.startAutoRefresh()
    . Do i only need to call this inside
    _app.tsx
    and then it does its magic? Or do i need to do further digging inside the session object?
    n
    j
    g
    • 4
    • 14
  • [ISSUE] app_metadata error
    s

    sigh839493

    04/25/2023, 9:40 AM
    Hello, I keep getting the below error when I do the following: data = supabase.auth.verify_otp({ "phone": self.phoneNumber, "token": self.phoneToken, }) what am I missing?

    https://cdn.discordapp.com/attachments/1100355684991762453/1100355685427982376/supabase_otp_error.png▾

    n
    • 2
    • 2
  • Reload the page after signing out
    k

    KBar

    04/25/2023, 9:48 AM
    Good or bad? It seems to me that reloading is better and safer since it ensures the state is fully reset. Or is it unnecessary? Most of the examples employ a simple rewrite (client-side transition) and it seems like a good user experience. Which one do you prefer? In which scenarios would you use one over the other? Thanks!
    t
    f
    j
    • 4
    • 5
  • Deploying Supabase App on fly.io - Best Practice for Setting Environment Variables
    b

    bkyerv

    04/25/2023, 11:26 AM
    I am having trouble deploying my app that uses Supabase on fly.io because environment variables are not accessible unless explicitly set using fly.io. The docs suggest using a TOML file to set non-sensitive information as environment variables, but it's unclear if the Supabase URL and Supabase anon key are sensitive. Should I set them using the TOML file, or is it better to use the fly.io CLI, which is recommended as a more secure way to set credentials and passwords?
    l
    s
    • 3
    • 2
  • Problems with oak
    n

    Novus

    04/25/2023, 1:15 PM
    Hello, I hope that someone can help me. I tried to implement oak in my edge-function.
    Copy code
    js
    import {serve} from "https://deno.land/std@0.168.0/http/server.ts"
    import { Application, Router, type Context } from 'https://deno.land/x/oak/mod.ts';
    
    serve(async (_req: unknown) => {
      try {
    
        const router = new Router()
        router
            // Note: path should be prefixed with function name
            .get('/oak-server', (context: Context) => {
              context.response.body = 'This is an example Oak server running on Edge Functions!'
            })
            .get('/oak-server/redirect', (context: Context) => {
              context.response.redirect('https://www.example.com')
            })
    
        const app = new Application()
        app.use(router.routes())
        app.use(router.allowedMethods())
    
        await app.listen({port: 8000})
    
    
        return new Response(String(), {status: 200})
      } catch (err) {
    
    
        //console.error(err)
        return new Response(String(err?.message ?? err), {status: 500})
      }
    }).then(r => console.log(r))
    If I sent the get request I receive in all requests > can only listen once Can someone help me?
    s
    • 2
    • 10
  • Syntax error when creating db function
    p

    PatrickJ

    04/25/2023, 1:47 PM
    Hello everyone, I'm attempting to write my first function that will perform the following tasks: 1. Clear all records from the "points" table. 2. Insert new records into the "points" table. 3. Regenerate the geospatial index. However, when running the function, I'm receiving the error message "Failed to run SQL query: syntax error at or near ';'". I don't find this error message helpful at all, and I suspect the issue may be located elsewhere. Can someone please assist me with this? Below is the code I've written:
    Copy code
    create or replace function update_points(new_points point[])
    returns void
    language plpgsql
    security definer set search_path = public
    as $$
    begin
        -- Start transaction
        begin;
    
        -- Delete current points
        delete from points;
    
        -- Insert new points
        insert into points (name, location)
            -- Loop over the array of new points using generate_series
            select new_points[i].name, 
                -- Use ST_MakePoint to create a point geometry from the longitude and latitude values
                -- Use ST_SetSRID to set the correct SRID (4326) for the geography type
                st_setsrid(st_makepoint(new_points[i].lon, new_points[i].lat), 4326)
            from generate_series(array_lower(new_points, 1), array_upper(new_points, 1)) as i
            -- Filter out any records where the name, longitude, or latitude is NULL
            where new_points[i].name is not null 
                and new_points[i].lon is not null 
                and new_points[i].lat is not null;
    
        -- Rebuild the spatial index
        reindex index points_geo_index;
    
        -- Commit transaction
        commit;
    end;
    $$;
    g
    • 2
    • 3
  • How to install dbdev in seed.sql
    c

    chirptune

    04/25/2023, 2:44 PM
    The dbdev install script works if I run it manually when running through
    psql
    , but when I add this script to supabase/seed.sql and I reset the db, it fails saying:
    Copy code
    Error: ERROR: schema "pgtle" does not exist (SQLSTATE 3F000)
    Sometimes I run some tests without
    begin
    and
    rollback
    to see what the data looks like when they fail, and resetting deletes all that data and installed extensions, so I like resetting for that reason.
    s
    • 2
    • 2
  • Is there a way to perform advanced queries on the API logs?
    d

    Dan Rumney

    04/25/2023, 2:55 PM
    I'm trying to generate a response time distribution for inbound queries and am hitting a problem. Normally, I'd use a CTE, but the dashboard doesn't seem to support those. Also, there doesn't appear to be a way to access the data remotely. For instance:
    Copy code
    WITH response_times AS (
            select
              request.path,
              response.origin_time AS time
            FROM
              edge_logs t
              cross join unnest(metadata) as m
              cross join unnest(m.response) as response
              cross join unnest(m.request) as request
            ORDER BY
              request.path ASC, response.origin_time ASC)
              SELECT path, time from response_times;
    Responds with
    can't find source response_times
    Is there a way to do advanced querying?
    s
    • 2
    • 2
  • SQL to reset storage bucket
    v

    ven

    04/25/2023, 3:03 PM
    I have a sql script to create a storage bucket and set policies on it like so
    Copy code
    -- -- create bucket saas;
    insert into storage.buckets (id, name) values ('saas', 'saas');
    
    -- create policies for the newly created buckets
    -- Allow public access to any files in the "saas" bucket
    create policy "Public Access"
    on storage.objects for select
    using ( bucket_id = 'saas' );
    
    -- Allow select access to any files in the "saas" bucket
    CREATE POLICY "Give users select access to own folder" ON storage.objects FOR SELECT TO public USING (bucket_id = 'saas' AND auth.uid()::text = (storage.foldername(name))[1]);  
    
    -- Allow insert access to any files in the "saas" bucket
    CREATE POLICY "Give users insert access to own folder" ON storage.objects FOR INSERT TO public WITH CHECK (bucket_id = 'saas' AND auth.uid()::text = (storage.foldername(name))[1]);
    How do i prepend this script with an "if exists drop/delete bucket 'saas'"? thank you
    g
    • 2
    • 20
  • Storage Smart CDN is slower than AWS cloudfront too much
    c

    chris ho

    04/25/2023, 3:13 PM
    Hi All, i just did a benchmark to compare Supabase Storage CND vs AWS cloudfront with the same file size, the result was so surprise me, i'm considering which one is better, but now no doubt about that (LOL), maybe i should wait until Supabase Storage v2 come out?
  • Storage Smart CDN is slower than AWS cloudfront too much
    c

    chris ho

    04/25/2023, 3:23 PM
    Hi All, i just did a benchmark to compare Supabase Storage CND vs AWS cloudfront with the same file size, the result was so surprise me, i'm considering which one is better, but now no doubt about that (LOL), maybe i should wait until Supabase Storage v2 come out?

    https://cdn.discordapp.com/attachments/1100441984960839831/1100441985283797123/image.png▾

    b
    • 2
    • 1
  • Quick way to get logged in to app when running locally?
    c

    CamBlackwood

    04/25/2023, 3:59 PM
    Is there a quick way that I can log into my web app when running locally? I'm currently using magic link and can't find a clear way
    g
    s
    • 3
    • 4
  • FDW for RestAPI that already accepts SQL
    n

    no1home

    04/25/2023, 4:48 PM
    I'm working on integrating data from a proprietary OSquery management server into Supabase using foreign data wrappers. However, the RESTful API endpoint I need to connect to requires passing a SQL query as a parameter, which is causing some query inception. Has anyone written a foreign data wrapper for an existing RESTful API endpoint with similar requirements in Supabase and could share any tips or resources they found helpful in the process? Any help or guidance would be greatly appreciated! I know I'm going to struggle because OSquery isn't postgres but going to cross that bridge later
    g
    • 2
    • 6
  • Flutter Deep Linking Not Working
    s

    Sonny Vesali

    04/25/2023, 5:24 PM
    Hi so I have this issue with using google OAuth to login a user in my app. In my supabase dashboard I've set the site url to the bundle_id like so
    com.supabase_auth_sandbox.app
    I've also set the sub-domain for it like this
    com.supabase_auth_sandbox.app://login-callback/
    And basically have followed the steps outlined https://supabase.com/docs/guides/getting-started/tutorials/with-flutter#setup-deep-links for the setup of deep links. When the user goes through the auth flow with google the redirect link (altered for brevity) is as follows: https://PROJECT_ID.supabase.co/com.supabaseAuthSandbox.app#access_token=ACCESSTOKEN&expires_in=3600&provider_token=PROVIDER_TOEKN&refresh_token=REFRESH_TOKEN&token_type=bearer and gives me the following error on screen
    Copy code
    {message: "No API Key found in request", "hint": "No `apikey` request header or url param was found
    any help would be appreciated, I'm just testing the waters right now on iOS but I wouldn't doubt that the same problem is present on android as well. Thanks
    g
    t
    • 3
    • 65
  • Postgres: must be owner of event trigger pgsodium_trg_mask_update
    b

    brad

    04/25/2023, 5:35 PM
    I am trying to migrate to Supabase Postgres from a MySQL 8 database using nmig (https://github.com/AnatolyUss/nmig). I am seeing errors during migration and I am not sure if/how to solve them. Help would be appreciated!

    https://cdn.discordapp.com/attachments/1100475276938444943/1100475277257228368/image.png▾

    • 1
    • 1
  • failed to update pg.tables with the given ID: permission denied for schema public
    p

    Pryapus

    04/25/2023, 6:23 PM
    I can't edit or create any talbles. I am using the superuser (e.g organisation owner) in a project (creating users always leads me to a localhost, never got that working) And i know its something with postgres. How can i give the organisation owner (e.g me) these permissions
    g
    • 2
    • 7
1...191192193...230Latest