https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • How to use signInWithPassword (in flutter/dart)
    d

    damonrand

    02/27/2023, 1:39 PM
    Hi there, Seems like a pretty basic thing, but I'm not able to use signInWithPassword() when I use InviteUser from the supabase backend. I don't have a frontend yet and I don't know the default password. So I'm trying to get in with the Flutter api. I can get hold of the Bearer token by emailing myself a magiclink then following that through. With the Bearer token for the user I'm now trying to update my password:
    Copy code
    final UserResponse res1 = await supabase.auth.updateUser(
        UserAttributes(
          password: 'mypassword1234',
        ),
      );
    This gives AuthException(message: Not logged in., statusCode: null) I can't figure out how to get the Flutter code to take my Bearer token. Out of the box ideas welcome as well!
    • 1
    • 5
  • Return single object instead of array of one object
    v

    Vimes

    02/27/2023, 2:10 PM
    I'm trying to return the username and email of a single signed on user. I get this data back as an array of one object. Accessing this object (seems to me) very cumbersome and I don't see a need for running a map on something that is always one object. Is it possible to get the return as not an array (where I have to access variable[0]. I've tried using the "single()" optims but it does not seem to change anything
    Copy code
    js
    const { data: profile, error } = await supabase
        .from("profiles")
        .select(`id, first_name, last_name, organization(name, umbraco_id, umbraco_url).single()`);
    c
    g
    • 3
    • 10
  • Are triggers the only way to autoset the value of a column in Supabase
    c

    ctulek

    02/27/2023, 2:46 PM
    Imagine you have a messages table and each message has an audience field defined as an array. Each time there is a new message, you want to set that array with the ids of the members of a channel. You can do it through the client side, but: * You may not want to expose the list of members to the sender * It can result in in consistencies * And it feels ugly for many other corner cases like "how about if the audience is large" etc. In regular infrastructure, you will have an API handler to add those values, or write an INSERT SQL with the field calculated. I guess Trigger functions is one way of doing it, but are there other ways like some kind of middleware that I can hook to Supabase REST API?
    g
    • 2
    • 3
  • How do know (on backend) if the user signed up with an OAuth provider?
    j

    jfbn

    02/27/2023, 4:57 PM
    My best idea so far is to check if the
    raw_user_meta_data
    on the auth.users table contains any identifications, such as
    google
    or
    facebook
    . This feels like a hacky workaround. I just want to create an entry in my
    profile
    table that also contains their name, which is available in the
    raw_user_meta_data
    r
    g
    • 3
    • 31
  • # in url
    ř

    Řambo

    02/27/2023, 5:36 PM
    After logging in with discord provider why does the url become
    http://localhost:5173/#
    g
    s
    • 3
    • 21
  • Dashboard Session Duration
    f

    fredguest

    02/27/2023, 6:08 PM
    Was something recently changed with the dashboard session duration? The dashboard used to maintain my session for at least a week, and now I have to re-login repeatedly throughout the same day, not fun. I have the "JWT expiry limit" set to the max of 604800 seconds (1 week), but I don't think that applies to my session in the Supabase dashboard, just users in the app. Is there some other session duration setting I'm missing for the dashboard itself?
    g
    j
    • 3
    • 19
  • cannot import supabase module in nodejs (AWS amplify) backend
    v

    Vince

    02/27/2023, 6:15 PM
    This may seem like a basic nodejs question than a supabase question but I am having trouble properly importing it. In my root folder of my react native I had lib/supabase.js:
    Copy code
    import { createClient } from "@supabase/supabase-js";
    const supabase = createClient(
    ...
    )
    export { supabase };
    In my nodejs backend code, I tried importing it as:
    Copy code
    const supabase = require("../../../../../lib/supabase");
    In the logs it gives me this error:
    Copy code
    Cannot find module '../../../../../lib/supabase
    I'm sure I correctly set the path in my export but I haven't figured this out. I tried the ES6 import method as well, same thing. Tried
    Copy code
    import { supabase } from "../../../../../lib/supabase.js";
    , same thing Any idea how I should properly import it? Edit: I'm aware that the module is written in ES6 and I should rewrite it into commonjs just not sure how to rewrite the "createClient" import
  • Unable to get value of files search and store them in useState
    s

    salzar

    02/27/2023, 6:20 PM
    Im having some sort of type issue where FileObject is not a valid type anywhere. I cannot figure out how i can store the results of searching for files in a bucket as a useState. I keep getting the issue as seen in the screen shot. Any help would be very much appreciated
    • 1
    • 6
  • Please remove my account
    e

    Enrico

    02/27/2023, 6:42 PM
    Help me remove my account so I can re-register through Github for the 2FA
    g
    • 2
    • 1
  • Getting !!! TypeError: __init__() got an unexpected keyword argument 'file_size_limit'
    c

    CubeX Tuugel

    02/27/2023, 7:27 PM
    I get this error when trying to load a file into supabase bucket through python. Another person is also having the same error which you can find on Github issues. Can anyone help please. Doesn't seem to matter what version of supabase and Storage3 I am using.
    g
    n
    a
    • 4
    • 8
  • What's the easiest way to create a session on the backend from the session JWT on a mobile client?
    s

    stillmotion

    02/27/2023, 7:28 PM
    I have a next.js app that uses
    auth-helpers-nextjs
    for authenticating the API endpoints. I'd like my iOS app to access those same endpoints, however, I need to construct a "supabase-auth-token" cookie with a json payload in order for the
    auth-helpers-nextjs
    middleware to correctly process the request. This seems a bit complex, since I have already fetched a session JWT on the iOS client and can send it as a bearer token header. What can I use on the server side to construct a valid Supabase client based on that JWT?
    • 1
    • 1
  • Am I the only one where the "create or replace trigger" syntax does not work?
    j

    Julien

    02/27/2023, 8:17 PM
    I precise that I'm using the Supabase online version. I checked the PostgreSQL version with: ``SELECT version()`` and I get ``15.1``. So the syntax should work. So this is working:
    Copy code
    postgresql
    CREATE TRIGGER my_trigger_name
      AFTER INSERT OR UPDATE 
      ON public.my_table_name
      FOR EACH ROW
      EXECUTE PROCEDURE public.my_function_name();
    But this not:
    Copy code
    postgresql
    CREATE OR REPLACE TRIGGER my_trigger_name
      AFTER INSERT OR UPDATE 
      ON public.my_table_name
      FOR EACH ROW
      EXECUTE PROCEDURE public.my_function_name();
    I get the following error: ``Failed to validate sql query: syntax error at or near "TRIGGER"``
    g
    • 2
    • 7
  • any way to connect to supabase with next 13 ?
    g

    Grimmjoww231

    02/27/2023, 8:22 PM
    its giving me some drama. and is there a different way for us to think about server side and client side ? when it comes to supabase
    n
    b
    • 3
    • 2
  • Edge Functions IP Address
    o

    olinelson

    02/27/2023, 8:45 PM
    For the next person. If you are integrating with a service that requires you to whitelist IPs Edge functions are not suitable. “Thank you for contacting Supabase support. It is not possible to do this as our edge functions are deployed globally and doesn't have defined IP addresses.” Cheers
  • error RequestInit: duplex option is required when sending a body
    t

    Trey

    02/27/2023, 9:03 PM
    When trying to upload an image to Supabase Storage via Node.js, I'm getting this error:
    error RequestInit: duplex option is required when sending a body
    Does anyone happen to know of a fix for this?
    c
    • 2
    • 1
  • Can public write access for metadata be disabled?
    x

    Xyo

    02/27/2023, 9:06 PM
    Title. Looking to get rid of an extra query by storing the info as metadata. Security isn’t a huge concern, but preferably would not be writable by non service.
    g
    • 2
    • 12
  • Inserting own data
    r

    Ryan the Temp

    02/27/2023, 10:16 PM
    Hi, I'm new to supabase. What is the recommended way to insert/udpate own data. For example, If a I have a table called
    jobs
    in the js client, I can do:
    client.from('jobs').insert(jobData)
    if my jobs table has a column called
    createdBy
    , do I need to populated that using the
    .insert
    operation? or is that something that should be done on supabase side via a trigger?
    g
    • 2
    • 2
  • Image transformations not working properly for safari.
    r

    ryanT

    02/27/2023, 10:31 PM
    I'm noticing that image transformations are working fine in chrome but when I check in safari the image is being cropped weirdly. See the attached images, I'm seeing these in safari. I notice that if I try to add a transform param to the image loader url, i can get this behaviour in chrome too. Omitting it makes it work properly.
    Copy code
    export default function supabaseLoader({ src, width, quality }) {
      return `https://${
        process.env.NEXT_PUBLIC_SUPABASE_STORAGE_HOSTNAME
      }/storage/v1/render/image/public/${src}?width=${width}&quality=${quality || 75}&transform=contain`;
    }
    Here is how I'm rendering the image:
    Copy code
    <Image
                  alt="logo"
                  height={0}
                  priority={true}
                  src={`${getOrgAssetsUrl(orgId)}/org-logo.png`}
                  width={LOGO_WIDTH}
                />
    • 1
    • 1
  • What happens if I have an exceeded use in my free plan database?
    k

    Kelvinauta

    02/28/2023, 12:48 AM
    I have exceeded usage in my free plan database, however I am not being charged extra and my project has not been disabled either, I am confused, I don't know if I will be charged later or my project is in danger of being disabled
    g
    • 2
    • 8
  • Can I create "service role" tokens for my developers with specific permissions?
    k

    Kelvinauta

    02/28/2023, 1:16 AM
    I'm going to put help from developers to use supabase, however I saw that with the service_role secret token you can have access to absolutely everything, and I would like to restrict some things, is it possible to not give them access to this token? and give it another that if you have certain permissions to see all the database tables but not be able to do other things beyond that?
    g
    • 2
    • 13
  • Disable email sign in with AuthUI?
    y

    YourAverageTechBro

    02/28/2023, 2:10 AM
    Is there a way to not show email sign in with the AuthUI component and only allow people to sign in via social platforms?
    s
    • 2
    • 1
  • fetch user from database with sensible info
    l

    lecookie

    02/28/2023, 2:37 AM
    So I have a profile table where there are all the users. In it there is the token which shouldn't be given to everyone but there is also the need for public for the other info
    g
    • 2
    • 2
  • E2E
    v

    VimHax

    02/28/2023, 3:00 AM
    I want to add E2E testing for my app and I was thinking of using GitHub actions to do this. Instead of hitting the production DB I want to try creating a local instance of Supabase on GitHub actions and run tests there. Is this is a good idea and if so how do I go about doing this? I'm using the storage/auth/realtime/postgrest/edge features of Supabase in the app.
    n
    h
    • 3
    • 2
  • AWS API Gateway JWT Authorizer
    c

    Crow

    02/28/2023, 3:12 AM
    I am using AWS API Gateway http apis infront of some Lambdas and I am looking to move my auth to Supabase. Currently I am using Auth0 as my JWT authorizer for API GW and I am wondering if I can use SB auth as a JWT authorizer as well. I know SB auth uses JWT but I can't seem to set SB as my JWT authorizer in API GW. When I use my SB Project URL as my issuer I get this error:
    Copy code
    Caught exception when connecting to https://lleqxeylhpehibciywmv.supabase.co/.well-known/openid-configuration for issuer https://lleqxeylhpehibciywmv.supabase.co. Please try again later. Error: Invalid issuer: https://lleqxeylhpehibciywmv.supabase.co. Issuer must have a valid discovery endpoint ended with '/.well-known/openid-configuration'
    What should I be using as my issuer URL? I also attached a screenshot of what the Auth0 JWT authorizer configuration would look like in API GW. Thank you for your time.
    v
    g
    • 3
    • 8
  • Setting MIME when uploading image to storage while using REST
    s

    sergiofra98

    02/28/2023, 3:46 AM
    Hey all, im working on a retool module where i can upload images to a bucket, i found POSTing the file via the REST API
    supabase.co/storage/v1/object/bucker/image.jpg
    worked on uploading the file, its detected as an octet-stream, i cant seem to find how to set the file MIME type, any ideas?
    g
    • 2
    • 12
  • Sign Up/Sign In flow templates
    n

    Noah Burroughs

    02/28/2023, 4:14 AM
    What is the recommended/go to library for auth flow with React? Is it Auth UI? Or are most people rolling their own solutions? I tried rolling my own but ran into a few issues and figured it may be easier to use a library for this. Curious what others are doing in this space
    n
    s
    g
    • 4
    • 6
  • Edge Function Deployment Error
    k

    Kevin Cantrell

    02/28/2023, 7:29 AM
    I have deployed a function before, everything went well. Now, I am getting this error: 2023/02/28 17:00:33 DNS Start: {Host:api.supabase.com} 2023/02/28 17:00:33 DNS Done: {Addrs:[{IP:IP WAS HERE Zone:} {IP:IP WAS HERE Zone:}] Err: Coalesced:false} 2023/02/28 17:00:33 Connect Start: tcp IP WAS HERE :443 2023/02/28 17:00:33 Connect Done: tcp IP WAS HERE:443 2023/02/28 17:00:33 TLS Start 2023/02/28 17:00:33 TLS Done: {Version:772 HandshakeComplete:true DidResume:false CipherSuite:4865 NegotiatedProtocol:h2 NegotiatedProtocolIsMutual:true ServerName:api.supabase.com PeerCertificates:[0xc000016580 0xc000016b00 0xc000017080] VerifiedChains:[[0xc000016580 0xc000016b00 0xc000a15080]] SignedCertificateTimestamps:[] OCSPResponse:[] TLSUnique:[] ekm:0x638780} 2023/02/28 17:00:33 Sent Header: :authority [api.supabase.com] 2023/02/28 17:00:33 Sent Header: :method [GET] 2023/02/28 17:00:33 Sent Header: :path [/v1/projects/my project name was here/functions/ttn-integration] 2023/02/28 17:00:33 Sent Header: :scheme [https] 2023/02/28 17:00:33 Sent Header: authorization [Bearer My Token was here] 2023/02/28 17:00:33 Sent Header: user-agent [SupabaseCLI/1.38.7] 2023/02/28 17:00:33 Sent Header: accept-encoding [gzip] 2023/02/28 17:00:33 Send Done 2023/02/28 17:00:34 Recv First Byte Error: Unexpected error deploying Function: {"message":"Forbidden resource"} I attempted to delete the function from app.supabase.com, I am still unable to create this function and My previous one is gone 😦
    n
    m
    m
    • 4
    • 4
  • flutter + LinkedIn auth nightmare
    b

    BladeRunner_K

    02/28/2023, 7:52 AM
    Help me understand how LinkedIn (3-legged token auth flow) is supposed to work in supa. Nothing on flutter or dart, just js and Go and it’s not clear on what schema to use. Here’s my issue 1. Launch browser using api call? This is confusing as LinkedIn doesn’t return a Bosh on first api call. It returns HTML content
    x-www-form-urlencoded
    2. I can force a launchURL action to open browser, but that’s dumb. Stupid dumb. 3. Even then, I’m stuck at the token exchange. How in the world to actually capture the ‘code’ value in the browser and pass it as a param. What does supa do? How does it do it where’s it stored how do I send the last POST request etc.
  • Timeout on channel subscription with C# client
    k

    keks

    02/28/2023, 10:17 AM
    I hope this is the right place to ask about the c# client. When I subscribe to a table or broadcast channel I get a
    PushTimeoutException
    . For the table I enabled realtime in the table properties. When only using broadcast channels, my understanding is that it should work out of the box or do I have to create the channels somewhere? Here is the code I use to listen to broadcasts:
    Copy code
    cs
    // client is the SupabaseClient, logged in and I do DB queries with it successfully
    var rtClient = await client.Realtime.ConnectAsync();
    var channel = rtClient.Channel("any");
    broadcast = channel.Register<PrefBroadcast>();
    broadcast.OnBroadcast += ChannelOnOnMessage;
    await channel.Subscribe();
    Edit: Listening for table changes works from typescript. For completeness, here is my attempt to listen to table update events:
    Copy code
    cs
    await client.Realtime.ConnectAsync();
    var prefTable = client.From<Preferences>();
    var channel = await prefTable.On(Client.ChannelEventType.All, PrefUpdate);
    await channel.Subscribe();
  • 403 - permission denied to setrole "supabase_admin"
    p

    Painini

    02/28/2023, 11:28 AM
    Hello! I am working on setting up Supabase with React Native. I have set up a User with the supabase_admin role in the dashboard and can successfully Sign in to it through the app. I am trying to retrieve data from a table with RLS on and I cannot seem to get permission to the table. The table has a policy that allows SELECT commands from users with the role supabase_admin. I tried passing ownership of the table to postgres but that did nothing. Anyone have ideas on where my problem lies? Edit: This error persists with or without RLS on the table, remove RLS tag. I cannot get or add data to any table through the app.
1...148149150...230Latest