https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • PRIVATE KEYS
    a

    aunum

    02/17/2023, 10:10 PM
    Is it okay to expose both the anon_key and auth_url on the frontend client?
    m
    s
    • 3
    • 4
  • Confirming a user email change with OTP
    m

    mkern

    02/17/2023, 10:11 PM
    I'm trying to let a user update their email address while being signed in. Using the email link works for confirmation, but using
    verifyOtp
    with the emailed token doesn't. Am I using the correct method for token verification?
    Copy code
    client.auth
      .verifyOtp({
        email: new_email,
        token,
        type: "email_change"
      })
    request payload:
    Copy code
    {"email": <new_email>,"token":<token>,"type":"email_change","gotrue_meta_security":{}}
    response payload:
    Copy code
    {
      "code": 404,
      "msg": "User not found"
    }
    j
    • 2
    • 3
  • signInWithPassword returns old data from database
    r

    Rasta

    02/17/2023, 10:21 PM
    i created a profiles table following this guide: https://supabase.com/docs/guides/getting-started/tutorials/with-sveltekit but added 'username' and 'role' only to the profiles table. username default is the email the user used to register and role default is the string 'user' all works ok, i register users and login and logout, the issue is that signInWithPassword is returning old data when login in
    Copy code
    const { data, error: err } = await locals.sb.auth.signInWithPassword({
                email: body.email,
                password: body.password
            })
    
            if (err) {
                if (err instanceof AuthApiError && err.status === 400) {
                    return fail(400, {
                        error: "Invalid credentials",
                    })
                }
                return fail(500, {
                    message: "Server error. Try again later.",
                })
            }
            console.log(data);
    the login is succesful but when logging the data data.session.user.user_metadata and data.user.user_metadata returns this for the 2 users i have (the original data when user was created):
    Copy code
    user_metadata: { role: 'user', username: 'emailone@gmail.com' },
    user_metadata: { role: 'user', username: 'emailtwo@gmail.com' },
    and it should return this (the data in the database, see img attached):
    Copy code
    user_metadata: { role: 'admin', username: 'pathone' },
    user_metadata: { role: 'user', username: 'pathtwo' },
    is signInWithPassword the correct way to get user metadata from the profiles table or how can i get the correct, current data from the profiles table when a user logs in?
    g
    • 2
    • 11
  • my golden ticket shipment
    x

    Xolify

    02/18/2023, 12:39 AM
    @Aqxy hey! I was hoping you could let me know when my shipment would arrive. We were talking on email but I like contacting on discord more easier
    s
    • 2
    • 2
  • View source code for view
    e

    elliott

    02/18/2023, 1:43 AM
    I've accidentally deleted the SQL that generated one of my views. Is there any way to see this code again, since the view still exists?
    g
    • 2
    • 2
  • Delete a table row in Python
    b

    BarefootDev

    02/18/2023, 2:10 AM
    supabase.table("tablename").delete().match({"uid": uid}).execute()
    This doesn't error, but it doesn't actually delete the row either. Any hints?
  • Is edge-runtime open source?
    b

    benjamin_dobell

    02/18/2023, 2:44 AM
    I'd like to diagnose an issue I'm running into. The aforementioned issue During local development, my
    import_map.json
    isn't being applied when executing
    supabase functions serve
    (all) but it is working if I serve just one function directly i.e. using the
    deno-relay
    container. I can see it's mounted into the
    edge-runtime
    container as I'd expect, but when the function runs it crashes due to import paths being incorrect. In order to diagnose I presumably need to need to know what the
    edge-runtime
    binary in that container is doing 😅
  • Does calling sign out through browser, sign out the user from the server?
    d

    DYELbrah

    02/18/2023, 3:24 AM
    Lets say a user calls the supabase.auth.signOut() fn from the client directly. If the server itself tries to make a call after, would it still be considered signed in/able to retrieve data? Perhaps I'm not looking at this correctly. Specifically using NextJS in case that matters.
    g
    • 2
    • 7
  • Can I create a trigger when file upload inside Admin UI
    d

    Dong

    02/18/2023, 6:17 AM
    I have a lot of images that I want to upload to Supabase. but I need to have a clear way to retrieve these files in my application. The methods I can think of are 1. Is there a way to have a trigger that automatically creates the URL row of the upload with some meta fields in my table. 2. Or I could specify the folder when I upload the images. Then I just need to get all the images based on the name of the folder. When I look at the API documentation. It looks like it can only retrieve all files from the bucket, not the folder? 3. Upload images to different buckets. In this case I need to create a lot of buckets and I don't think this is a good way to do it? Thanks for help
    g
    • 2
    • 2
  • Does supabase work offline for windows?
    y

    Yara

    02/18/2023, 6:46 AM
    Does Supabase capable to build a flutter windows application (offline & online) ? but my app contains too relational data, it's like POS system
    g
    • 2
    • 3
  • Does supabase support NOTIFY and LISTEN command?
    l

    lefantan

    02/18/2023, 7:49 AM
    Hi folks, just curious if supabase’s Postgres instance support the NOTIFY and LISTEN command? We want to use a Postgres adapter (https://socket.io/docs/v4/postgres-adapter/), but are curious if it’s possible using supabase.
    t
    • 2
    • 2
  • Auth UI
    d

    DisamDev

    02/18/2023, 10:41 AM
    I'm using the Auth UI component in NextJS and I create the component but it looks strange.
    • 1
    • 2
  • Did the SvelteKit Auth Helper get integrated into the supabase-js core library?
    i

    ixxie

    02/18/2023, 11:15 AM
    I noticed the getting started instructions for SvelteKit [1] have been simplified and no longer reference the auth helper. Has the team integrated this work with the core library? [1] https://supabase.com/docs/guides/getting-started/quickstarts/sveltekit
    s
    j
    • 3
    • 24
  • Supabase and Python
    h

    hgarg

    02/18/2023, 11:20 AM
    Supabase Python Community package client library doesn't work for our project. Are there some examples of using supabase auth and database REST API endpoints with Python using a generic package like Requests? Examples of a few operations and if they are feasible using the REST APIs? - check using email id, if a user exists - add a new user - CRUD operations on tables thanks
  • Realtime sync of database table in relation to users
    o

    ONA

    02/18/2023, 11:33 AM
    I am using the latest JS SDK Problem: I want to subscribe to changes of a database table when a row is added, deleted or updated which is in relation to the user. Row name -> Games A game have two players. Right now that is done with an array data type which consist of two ids. Have considered making a second table which is called game_players. All I find are some old code snippets for v1, which is not usable. i.e.
    Copy code
    js
        supabase.from('games').on('*', (payload) => console.log(payload))
    Does anyone have a good idea?
    g
    • 2
    • 18
  • How to _always_ cast Bigint values to text
    o

    osener

    02/18/2023, 11:49 AM
    Is there a way to configure Supabase to always return Bigint values as string to the client? I use bigint ids that are not sequential (see https://instagram-engineering.com/sharding-ids-at-instagram-1cf5a71e5a5c) and almost always they exceed JavaScript's number precision, causing the app to break because IDs become inaccurate. The only way to work around this that I know is doing my queries as `select("id::text, ..."), but this both breaks TypeScript type generation and is error prone. How can I make sure the API always processes these values as strings? I remember something like this was already done for Supabase's own admin dashboard. Type generation issue: https://github.com/supabase/postgrest-js/issues/370)
    g
    • 2
    • 1
  • How can I pass id in my vue component
    r

    Revaycolizer

    02/18/2023, 12:46 PM
    How can I pass an ID in vue component as the used docs is using script setup tag in vite which differs from the normal script tag in vue 3 Composition api
    s
    • 2
    • 1
  • How to filter a select by regex?
    t

    Twilkey(Limpious)

    02/18/2023, 1:18 PM
    I want to search inside a JSONB column for values that match emails with a specific domain. Lets say I have first.last@example.com. I need my query to find that database row because it matches the example.com inside the email. I know this can be done using regex, but I am not sure if or how to use regex inside Supabase. Here is my code to match inside a JSONB object without regex.
    Copy code
    let { data, error } = await supabase.from('sites')
                    .select('*') 
                    .not('lastupdated', 'is', null)
                    .contains('sitedata->plugins', JSON.stringify([{'email': var}]));
    g
    • 2
    • 12
  • On new user SignsUP receive an error 500
    i

    Irfan Ahmed

    02/18/2023, 2:45 PM
    Everything was working fine till a day before but all of a sudden this problem starts, I am sending username and password in JSON as below: { "email": "username@testmail.com", "password": "password" } response as below: { "code": 500, "msg": "Database error saving new user", "error_id": "79b788b2937d2d1e-IAD" }
    s
    g
    • 3
    • 5
  • Making sure a user can give a vote to a content only once
    o

    Oxey405

    02/18/2023, 3:08 PM
    Hello ! I am trying to make an app that involves users upvoting content (in this case, giving a ⭐) Unfortunately, after searching on Google, I could not find results that fixed this flaw. Currently my RLS policy allows for registered to vote (inserting a new row in the votes table) but I have no idea how to check if the user has already voted for that content (meaning to cross-check if the userID (stored in a column) has already voted for that content (an ID stored in another column). How do I implement such a policy ? Thank you for reading and have a nice day 🙂
    g
    • 2
    • 1
  • Firebase login with Supabase
    a

    avalanche

    02/18/2023, 3:41 PM
    PS: or with 'sign_in_with_apple' and 'google_sign_in' packages
  • Full-text-search configuration: Can I upload dictionaries / thesaurus files?
    e

    eijk

    02/18/2023, 3:20 PM
    I am currently reading into Postgres configuration for full-text search, and it seems, some of it needs ability to place files into
    $SHAREDIR/tsearch_data
    . Is it possible to upload files there for hosted supabase? Can it be done via the SQL editor? Or the CLI? See https://www.postgresql.org/docs/current/textsearch-dictionaries.html.
    g
    • 2
    • 2
  • Provider token in session - losing the token
    i

    iowageek

    02/18/2023, 3:52 PM
    I'm trying to use the provider_token (or provider_refresh_token) that supabase is returning me in the session. I'm using the sveltekit helper. After I login and move around in the application for a while it works fine. I check for the provider token and if present I go ahead and make the calls to the google photos api I want to with that token. After either a period of time or my local server going to sleep and coming back I completely lose the provider token. Is this because it is being stored on the server in a session somehow? I can't find a cookie that looks like it is saved anywhere on the local client to try and grab either? Is there a way to just force a refresh with a valid supabase token to then return a new provider token without logging in again? Just trying to get this right. I also want to run my sveltekit app on Vercel or some other serverless platform so the server itself will be stateless.
    g
    j
    s
    • 4
    • 8
  • Why are Supabase functions "data-first"?
    k

    Ken

    02/18/2023, 4:38 PM
    Hi Team, New to TypeScript/JS land. I noticed that node promoters "error first" callbacks. It seems like all Supabase funcs are "data first" with the error second. Can someone fill me in on the philosophy here?
    s
    • 2
    • 7
  • use in pure js
    l

    Ladislav

    02/18/2023, 4:54 PM
    Hello, is it possible to use supabase client to insert data from a client-side page?
    s
    g
    • 3
    • 32
  • Custom provider signup with Supabase and Flutter
    a

    avalanche

    02/18/2023, 4:54 PM
    Is there a way to use custom provider to sign user into Supabase? I'd like to use TikTok for example, which is not available on the list of providers supported by Supabase.
    s
    • 2
    • 3
  • Supabase cookies
    d

    DisamDev

    02/18/2023, 5:30 PM
    There is some way to change the name of the supabase cookie in the web? By default it is called supabase-auth-token, we can change it?
    s
    • 2
    • 1
  • Session is null after logging in
    p

    paulw

    02/18/2023, 5:35 PM
    Hey all, currently experiencing issues with getting the session from
    auth.getSession
    in a nextjs app. I've raised an issue here 👉🏾 https://github.com/supabase/supabase/issues/12522 Any help or feedback would be greatly appreciated!
    g
    d
    • 3
    • 4
  • supabaseUrl is required in production
    e

    ethanfox

    02/18/2023, 5:38 PM
    My sveltekit project keeps getting a console error of "Uncaught Error: supabaseUrl is required." when attempting npm run preview. I'm not sure what is causing this. My .env file is set up according to the SveltKit auth helpers guide in the docs. Ive also attached my createClient code as well. npm run dev works fine. Has anyone else run into this issue
    s
    • 2
    • 2
  • Supabase + Production grade chat Application (maintenance | architecture | performance)
    b

    bluetoothfx

    02/18/2023, 5:57 PM
    Hello everyone, thank you for providing such a great platform. I have some questions regarding building a production-grade application with real-time chatting and communication using Supabase. I have reviewed some examples on the Supabase website and community repository, and while they are a good starting point, I have concerns about the performance of the message table in a production environment. As the table grows with usage, it may require indexing or partitioning or sharding to maintain performance. As Supabase is a managed solution, I am wondering if this is something I need to worry about, and what the recommended approach is for handling such situations. Currently, we are considering communicating with the Supabase server directly through the Flutter SDK and not using a middle layer such as an API or caching server. Do we need to consider this in our approach, and if so, what technical details should we keep in mind? Thank you for any technical insights you can provide.
    s
    r
    • 3
    • 6
1...136137138...230Latest