https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Supabase Auth failing with An invalid response was received from the upstream server
    l

    lucis

    01/19/2023, 12:14 PM
    My project that uses Supabase Auth is currently breaking in login with the following error: An invalid response was received from the upstream server Both Github and Google sign-in get this You can try it at https://deco.cx/live
    e
    g
    s
    • 4
    • 12
  • auth.mfa.getAuthenticatorAssuranceLevel() returns wrong nextLevel
    t

    TomM101

    01/19/2023, 12:47 PM
    Not sure if this is a bug but when calling auth.mfa.getAuthenticatorAssuranceLevel() on a user with an MFA method it returns aal1 for the nextLevel, not aal2 as I think I'd expect according to this table
    b
    • 2
    • 1
  • How do I query through a joins table?
    i

    I.Cheered

    01/19/2023, 1:43 PM
    See the attached diagram. I have a course_id and I would like to fetch - The corresponding levels - The preset connected to each level - The notes connected to each preset Ideally in a single query. I currently have the following to fetch all levels and presets:
    Copy code
    js
    const { data: levels, error } = await supabase
            .from('levels')
            .select("id, course_id, sequence_id, presets:preset_id(id, name, cleff_id)")
            .eq('course_id', course.id)
    I don't know how to query 'through' a joins table to fetch the notes though. Does anyone have an idea?
    g
    • 2
    • 5
  • More than one site URL per project
    g

    Guy Rozen

    01/19/2023, 2:34 PM
    I am required to have different redirects based on environment. I've noticed that adding a new redirection URL is often ignored, and that the "Site URL" is the one that takes over integration redirections. Is there a way to bypass the Site URL based on environment? Maybe more than one Site URL per project? Or is it required to have a project per environment? If so, is there a way to clone projects with ease?
    g
    • 2
    • 3
  • API documentation for not using the client libraries
    h

    Hultnér

    01/19/2023, 2:41 PM
    Hello, I'm new here. We've decided to try to supabase for a new project, however we are building a native application and can't use the client libraries. In the documentation I only find examples on how to do things using the client library. Can I find documentation on how to make the requests manually somewhere? Specifically I'm looking into auth, user registration (with email), login, verification, and account recovery.
    g
    • 2
    • 8
  • Can you listen for realtime changes on a database view (as opposed to a table)?
    d

    dextah

    01/19/2023, 3:14 PM
    Can you listen for realtime changes on a database view (as opposed to a table)?
    g
    • 2
    • 1
  • How do you check if the user has a password set
    m

    Michael Maust

    01/19/2023, 4:13 PM
    I am trying to figure out how to handle the routing for users that are sent a user invite email. I would like to be able to check on the middleware whether the user has a password set so I know if the user should be routed to the signup page or the account setup page that I have. Any idea on how I can do such a check?
    g
    r
    • 3
    • 3
  • Best practice to control access to files used by application?
    n

    NonStopDev

    01/19/2023, 4:49 PM
    I have a database table with a list of files in the bucket and the bucket is currently public just to test but trying to find the best process for handling this common interaction of being able to get content URLs and expiring them. When my app loads, I query the REST API and get a list of the last 10 images by timestamp which is simple. This is fed to the user and they can see them, fetch more, etc. What I want to do is convert the bucket to private and allow only logged in users to view these files. I am new to Supabase but trying to find the best practice how apps like this manage content. Is the best practice to do this on client side so I return the file names the app would display and then let the client side generate the actual URLs or should I use functions to return the signed URL from the server so the application is only getting the live URL?
    g
    • 2
    • 2
  • RLS allow only users with role "admin" to edit the rows
    m

    Martin Piliar

    01/19/2023, 4:57 PM
    Hey everyone! I'm struggling with RLS and giving just accounts with the role "admin" the permission to edit other rows. I have this policy:
    Copy code
    SQL
    CREATE POLICY user_roles_update_policy ON user_roles
    FOR UPDATE
    TO public
    USING (role = 'admin' AND user_id = auth.uid());
    but it doesn't allow me to edit anything, even though the logged user with the user_id has a role 'admin', am I missing something? I want the admin users to edit other users roles. Thank you!
    g
    • 2
    • 45
  • edge functions admin client?
    a

    athomas

    01/19/2023, 5:34 PM
    does anyone know if there is a way to use other supabase features within an edge function with a client that is not tied to the client that called the function (for example, firebase functions have an admin sdk). I am trying to implement a shared timer using realtime and edge functions, where a client app calls an edge function which emits timer updates periodically via realtime broadcast. I keep getting channel errors on the edge function because I believe, since the client that you create on the edge function is the "same" client as the one that called the function, there is essentially the same client trying to connect to a realtime channel more than once. It would be nice to be able to use other supabase features like realtime within an edge function with something like an admin client that isn't seen as the same entity as the caller of the function and potentially could have some further capabilities that you wouldn't want to expose directly to an actual client (bypassing rls for some use cases, etc) let me know if anyone has any thoughts or solutions, thanks!
    j
    g
    a
    • 4
    • 5
  • The types shown after a query are unknown
    v

    Vik

    01/19/2023, 8:09 PM
    Looks like this was a known issue, not sure if V2 of the SDK fixed this though
    • 1
    • 1
  • hello I have a problem trying to migrate my project to production
    f

    Fainaru

    01/19/2023, 7:00 PM
    I am trying to migrate my online development project to my production project and it gives me this error
  • how to invoke functions like REST apis
    r

    rhenium2

    01/19/2023, 7:35 PM
    I am not able to figure out how I can invoke a function with a different http method (such as GET, PATCH, DELETE, etc).
    g
    a
    • 3
    • 7
  • Hi all,
    i

    Irfan Ahmed

    01/19/2023, 7:48 PM
    I am inserting a new row and sending the values through the API call, I am receiving the "Success 201" response but the inserted data is not returned (Example: row_id etc.,). I wanted to edit that newly inserted row using its unique row_id in the next call using patch method. I am creating the row partially as other partial data is passed on particular row_id with the next API call. I do not want to query with other parameters as those are not unique in the row. Please help me how do I get the success with response and data with new row details.
    g
    • 2
    • 4
  • How do I perform two database updates simultaneously safely?
    e

    elliott

    01/19/2023, 8:02 PM
    I need to make two calls to supabase, one to upload an image into its storage, and another to make an image data entry in the database, which associates the uploaded image's path with a profile. This works fine, but in the event that either of these calls fail, the other is not only useless, but creates a bad state in the database. For example: If image upload works, but the database insert fails, I have an image inserted into storage with no profile association. If image upload fails, but the database insert works, I have a database entry with a path that points to a null image. How can I build fault tolerance into my supabase calls that behave like this? If both are database calls I understand that I can make a special function that calls both, but if one is a database call and the other is storage I do not know how to do that.
    g
    i
    • 3
    • 23
  • Hey, is this a "bug"?
    j

    Johnny

    01/19/2023, 8:10 PM
    Hey, I am trying to make my SvelteKit+Supabase authentication working and encountered the following behaviour: with gmail you are able to add a "submail" as example email+sub@gmail.com. When I am creating an account with a user existing (email@gmail.com) I am getting
    Copy code
    ts
    data:  { user: null, session: null }
    err:  AuthApiError: duplicate key value violates unique constraint "users_email_partial_key"
        at E:\Programming\Svelte\Boilerplate\boilerplate\SvelteBoilerplate\node_modules\@supabase\gotrue-js\dist\main\lib\fetch.js:41:20
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (node:internal/process/task_queues:96:5) {
      __isAuthError: true,
      status: 500
    as response but the user with the + in the mail is being created. Anyone an idea why?
    s
    • 2
    • 1
  • Getting the following error with the latest sveltekit-auth-helpers:
    r

    rchrdnsh

    01/19/2023, 8:37 PM
    Dunno what's going on, but this error is blocking all js in production...anything I need to do? Here is my supabase client ts file in sveltekit:
    Copy code
    ts
    import { createClient } from '@supabase/auth-helpers-sveltekit'
    import { env } from '$env/dynamic/public'
    
    export const supabase = createClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_SUPABASE_ANON_KEY)
    ...which is copied directly from the docs... I have two separate sties that are both experiencing the same error ATM...
    j
    d
    • 3
    • 8
  • Using a where clause against an array where is index is specified
    j

    jh

    01/19/2023, 9:02 PM
    Hi, Anyone know what filter I should use when attempting to match an exact array item? Here is my actual SQL call that works:
    Copy code
    SQL
    SELECT *
    FROM "public"."view_storage_objects"
    WHERE bucket_id = 'avatars'
      AND path_tokens [1] = '988a5762-7859-4aa6-b9bd-78fabd775320';
    And here is the supabasejs code I attempted to use:
    Copy code
    ts
    const { data, error } = await supabaseClient
       .from('view_storage_objects')
          .select('name')
          .eq('bucket_id', 'avatars')
          .eq('path_tokens[1]', user.id);
    Unfortunately I'm thrown this error:
    Copy code
    json
     {
      code: "22P02",
      details: 'Array value must start with "{" or dimension information.',
      hint: null,
      message: 'malformed array literal: "988a5762-7859-4aa6-b9bd-78fabd775320"'
    }
    Any suggestions would be appreciated. Thanks!
    g
    • 2
    • 63
  • Question regarding free supabase plan
    r

    Rake

    01/19/2023, 9:14 PM
    Could I please get some clarification on what is meant by inactivity?
    g
    • 2
    • 8
  • Supabase UI - How to set a cell back to NULL?
    m

    moroshko

    01/19/2023, 11:59 PM
    In the Table Editor, is it possible to set a cell back to NULL after it's been populated?
    g
    • 2
    • 6
  • Sendgrid SMTP not working.
    j

    Joseph

    01/20/2023, 12:16 AM
    Hi, I'm trying to use Sendgrid to send emails from my own domain. Here is my setup:
    g
    • 2
    • 3
  • Current session and user data/automatic sign-up
    u

    1voy

    01/20/2023, 1:13 AM
    I'm making an app that only allows Twitter sign-in with OAuth. I am confused about what happens in the process, is it checking for the e-mail used for the Twitter account and whether it's in the registered users database? I only have a signin button right now but after signing in I am not landing on a protected route - do I need to make it automatically make an account and save it to the database using the Twitter credentials? I am basically trying to do exactly what tweethunter.io does when you try to login
  • Function to insert row after trigger w/ foreign key relation
    m

    mansedan

    01/20/2023, 1:39 AM
    Hey all, I'm trying to setup a trigger after insert on our 'comments' table that would then create a corresponding row in our 'notifications' table. The issue we are running into is w/ the function that runs. We need to pull the user/profile ID referenced in the created comment to use in the notification row. Our function definition is currently like this:
    Copy code
    sql
    
    begin
      insert into public.notifications (type, post, profile, sender)
      values ('comment', new.post, new.post.author, new.author);
      return new;
    end;
    Except
    new.post.author
    isn't working. What are we missing here?
    post.author
    being a Foreign Key to a uuid Thank you!
    g
    • 2
    • 5
  • Supabase CLI error
    l

    lampaboy

    01/20/2023, 3:24 AM
    Following the instructions here,, mainly to generate types for TS; https://supabase.com/docs/reference/javascript/typescript-support I have installed using
    npm install supabase --save-dev
    , after running
    supabase -h
    , it returns:
    Copy code
    supabase : The term 'supabase' is not recognized as the name of a cmdlet, function, script file, or operable 
    program. Check the spelling of the name, or if a path was included, verify that the path is correct and try    
    again.
    Not sure if it is the right way, but it works when I do
    npx supabase -h
    . Moving along with
    npx supabase init
    , it works and returns,
    Finished supabase init.
    . This then fails again at
    npx supabase start
    with:
    Copy code
    Error: error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/_ping": open //./pipe/docker_engine: The system cannot find the file specified.
      in github.com/supabase/cli/internal/utils.AssertDockerIsRunning:48
      in github.com/supabase/cli/internal/start.Run:34
    There seems to be a lot of issues, there are some workarounds, but I'd rather not initialize the project with workarounds at the moment. Does anybody have a solution for this?
    s
    • 2
    • 3
  • Possible to limit postgres_changes columns returned?
    r

    rlightner

    01/20/2023, 3:38 AM
    I'd like to limit what data is returned via the real-time call as it leaks out data I don't want "public"
    g
    • 2
    • 1
  • Cannot Delete User(s)
    r

    royboy789

    01/20/2023, 3:43 AM
    Been trying to delete auth users for a while now. When I try via the site I get an error "Failed to delete user: Failed to delete user" I tried using REST API - DELETE to xxx.supa.co/auth/v1/user/[user-id] That returns 401 with:
    Copy code
    {
      "code": 401,
      "msg": "invalid claim: missing sub claim"
    }
    Eventually I'll be building this into my code base when a user deletes account, but need to clean up test accounts and stuck here.
    g
    • 2
    • 13
  • Anywhere to find upcoming features?
    b

    BritLuey

    01/20/2023, 3:48 AM
    I've searched high and low, does anyone know of anywhere to find a road map or upcoming features for Supabase. I am building my first application with the product and I'm really curious as to how it could grow with what I'm building.
    g
    • 2
    • 1
  • Auth Helpers - where to put the Supabase Keys?
    j

    jinsley8

    01/20/2023, 7:08 AM
    I'm following the auth helper guide here for next.js but where do I put the keys? https://supabase.com/docs/guides/auth/auth-helpers/nextjs#usage-with-typescript Originally I was creating a client to use that had the keys but this guide doens't mention anything?
    Copy code
    js
    export const supabase = createClient<Database>(
       process.env.NEXT_PUBLIC_SUPABASE_URL as string,
       process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY as string
    );
    j
    • 2
    • 8
  • Edge Functions - npm import => "--no-npm is specified"
    b

    boeledi

    01/20/2023, 7:10 AM
    I am trying to import an npm package in a test Edge Functions and when I run the "supabase functions serve...", it loads all the parts of the npm package but ends with an error:
    Copy code
    Watcher Process started.
    error: Following npm specifiers were requested: "stream-chat"; but --no-npm is specified.
    Watcher Process finished. Restarting on file change...
    I am simply using the "serve" CLI as follows: supabase functions serve hello --debug Am I doing anything wrong?
    c
    l
    • 3
    • 2
  • How to filter many-to-many relationship tables with a join table.
    c

    cryptoneur

    01/20/2023, 9:30 AM
    I looked through discord on an example on how to filter a
    many-to-many
    relationship. I have the following relationship (see photo), where I have a join table
    grant-blockchains
    . In my frontend view, I wanna filter grants based on which blockchain they belong to. Just as explained here: https://supabase.com/blog/postgrest-v10, the pks of
    grant_blockchains
    are
    grant_id
    and
    blockchain_id
    . In my frontend, if a
    blockchain
    filter is selected, I wanna conditionally filter down grants to only those selected blockchains:
    Copy code
    let columns = 'id,logo,twitter,discord,github,telegram,updated_at,slug,name,blockchains(id)'
    let table = 'grants' 
    
    let query = supabase.from(table).select(columns)
    
    // these come in the forms of an array ['1','2'] and I convert them later to parseint to match the type
    if (queryFilters?.blockchains) {
      const blokchains = queryFilters?.blockchains.map((blockchain) => parseInt(blockchain))
      console.log({ queryFilters, blokchains })
      // add filter ids in blokchains table
      query = query.in('blockchains(id)', 'in', blokchains)
    }
    
    const { data, error } = await query
    I get the following error, but also I am not sure if I actually do this correctly:
    Copy code
    TypeError: values.map is not a function
        at PostgrestFilterBuilder.in
    I also tried the filter method but got the same error. Found also this on GitHub but seems it's solved? https://github.com/supabase/supabase/discussions/1080
    • 1
    • 1
1...102103104...230Latest