https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • PGP Encrypting OTP Emails
    t

    Tonic

    02/09/2023, 5:46 PM
    Hey ya'll - wondering if this is possible. I want to send an OTP email using supabase auth, but check if they have a PGP key in their WKD and encrypt the email with it before sending it. The clients that will be using this service would deeply appreciate this feature, so I'm curious if anyone has any ideas on how to make it happen.
  • How to use auth.admin.createUser to make a user with Phone provider
    l

    Luke

    02/09/2023, 5:48 PM
    It is my understanding that a user has a provider of either Phone or Email, and that the two cannot mix. (Example: if I try to login with OTP vis SMS on a Email provided user, it will not return that existing user even if the phone number matches, but will rather create a new auth with provider of Phone) If I want to pre-make an account for a user, I can use supabase.auth.admin.createUser to do so. When I do this, the provider defaults to Email no matter what, even if only a Phone number is provided and the account doesn't even have an email associated. Is there a way to generate an auth user like this with a Phone provider?
  • Unable to style supabase auth ui width
    c

    Cheqo

    02/09/2023, 5:50 PM
    Hello, I am struggling to change the width of a supabase auth ui component. Ideally, I simply want to apply tailwind classes - how do I do that? also why is default behaviour squished and not full width by default?
    Copy code
    <div className="flex bg-red-400 w-full">something</div>
                  <Auth
                    supabaseClient={supabaseClient}
                    appearance={{
                      theme: ThemeSupa,
                      className: {
                        container: 'w-full'
                      }
                    }}
                    providers={['google', 'apple']}
                  />
    c
    • 2
    • 3
  • JWTIssuedAtFuture
    r

    rem

    02/09/2023, 6:11 PM
    Our project is using clerk.dev to create a JWT token to talk to supabase, and in most cases it works. But quite often (during development), we'll get the JWT being rejected because of
    JWTIssuedAtFuture
    - postgres giving us
    PGRST301
    (which from what I understand it means the JWT isn't valid WRT timing). We've debugged it the point where it looks like the JWT is landing on supbase's side where the time is exactly the same - seconds-wise. i.e. it reads as the same time - not in the future. But I'm guessing that supbase isn't accounting for sub-second issue to usage. Besides putting in a 1 second delay (which would throttle every one of our request because we're doing auth checking on server side nav) - is there any solution or work around to this?
    g
    • 2
    • 4
  • showcase for supabase auth-ui based apps out there
    s

    somoni

    02/09/2023, 6:31 PM
    I am starting in supabase and was wondering if there is a place to showcase tutorials / apps based on auth-ui ? like a full application with code out there outside of the ones found the examples[1] directory ? [1] https://github.com/supabase/supabase/tree/master/examples
  • Superbase not loading projects
    c

    Colors

    02/09/2023, 6:35 PM
    I just installed superbase on my server. But when I try to acces my dashboard I get an 502 Bad Gateway error. When I manually open the url called in the request in the browser I get this error:
    Kong Error No API key found in request.
    r
    g
    • 3
    • 16
  • How to setup up roles for edge functions
    h

    Hugos

    02/09/2023, 6:38 PM
    I want normal application users to only be able to invoke a certain function on the edge which works great right now but inside that function I want to do some database queries as an admin and not as the user invoking the function. How can I achieve this?
    g
    j
    • 3
    • 10
  • Require email confirmation option is missing in supabase dashboard?
    l

    Lukas V

    02/09/2023, 6:40 PM
    Hello, is it just me or the require email confirmation toggle option is missing from Auth settings, I swear I could have toggled it on and off before, but now I just can't find it.
    g
    • 2
    • 9
  • Add bot scope with specific bot permissions to signInWithOAuth function
    f

    fast

    02/09/2023, 6:56 PM
    And how to add multiple scopes
    • 1
    • 2
  • Unable to login with email/pass
    t

    Trey

    02/09/2023, 6:57 PM
    Suddenly today I'm unable to login to app.supabase.com with an email and password. Looks like a bug may have been introduced recently. SSO to GitHub works fine for my personal account, but I can not get into my work account.
    g
    s
    • 3
    • 5
  • How to get Discord OAuth2 access_token from supabase acces_token?
    f

    fast

    02/09/2023, 7:10 PM
    I need the access token from discord but I only have the one from supabase. So is there a way to get the valid OAuth2 access token from discord by using the one from supabase?
  • Why is there a limit in SearchOptions() on the method .list() for storage?
    w

    Wizzel

    02/09/2023, 7:31 PM
    I want to check if a certain file already exists before starting a download. To do that, I was using
    Copy code
    dart
       final existingFiles =
            await Supabase.instance.client.storage.from('images').list(
                  path: Supabase.instance.client.auth.currentUser!.id,
                );
    but I noticed that I only got 100 files back, because that's the default limit for the `.list()`query. I am curious why there is a limit. As far as I understand, the
    .list()
    method only gets the metadata of the files and not the actual data, right? So is there a way to always get all file-names, no matter how many files there are in a bucket? If yes, what are the downsides of doing that?
    g
    • 2
    • 7
  • Supabase flutter package github oauth not redirecting to provided redirect url?
    m

    MrAmG17

    02/09/2023, 7:36 PM
    using flutters package trying to login with github -> https://[project].supabase.co/auth/v1/authorize?provider=github&redirect_to=HST0000001%3A%2F%2Fhost.com only shows blank screen... calling adb function to open specified "deep link" opens it in the app as expected .. So why does supabase dont redirect me to after successfull auth?
    • 1
    • 3
  • Account dissapeared? Password reset unresponsive
    a

    AllYourSupabase

    02/09/2023, 7:45 PM
    Supabase.com won't allow me to login anymore, and the password reset form is refusing to send me an email to reset my password. What do?
    j
    g
    • 3
    • 3
  • Getting a specifc user from uuid:
    t

    TobiasBm

    02/09/2023, 8:01 PM
    So I have a uuid that I want to use when selecting a specific user. But I get following error;
    Copy code
    type 'String' is not a subtype of type 'int' of 'index'
    I am retrieving the uuid from as following:
    Copy code
    dart
        final userId = supabase.auth.currentUser?.id;
    Which is a uuid as a String. Then I try to stuck it into the query like so:
    Copy code
    dart
    final data = await supabase.from("profiles").select('*').eq('id', userId);
    I have also tried without the * in select, same result. Thank you helping me ๐Ÿ™‚
  • Parsing request.json causes error
    h

    Hugos

    02/09/2023, 8:01 PM
    I have a simple edge function and whenever I invoke it it goes wrong on this line: ``const body = await req.json();`` with the following error:
    g
    • 2
    • 5
  • how do i get the nice looking auth-ui demos look and feel ?
    s

    somoni

    02/09/2023, 8:10 PM
    Not sure i f i need to include some css. I get this very "simple" looking now when i run this example[1] or when i import auth-ui-react in a simple react app [1]https://github.com/supabase/auth-helpers/tree/main/examples/nextjs
  • Can not find guide for React-native?
    d

    DevThoughts

    02/09/2023, 8:11 PM
    Is there a guide to work and setup with React-Native?
    g
    • 2
    • 3
  • new.raw_user_meta_data not working anymore
    n

    NinjaNuur

    02/09/2023, 8:53 PM
    I have this trigger
    Copy code
    CREATE OR REPLACE FUNCTION public.handle_new_user() RETURNS trigger as $$ begin
    insert into public.user (id, email, phone, first_name, last_name, role)
    values (
            new.id,
            new.email,
            new.phone,
            new.raw_user_meta_data->>'first_name',
            new.raw_user_meta_data->>'last_name',
            CAST(new.raw_app_meta_data->>'role' as public.role)
        ) ON CONFLICT (id) DO
    UPDATE
    SET (email, phone, first_name, last_name, role) = (
            new.email,
            new.phone,
            new.raw_user_meta_data->>'first_name',
            new.raw_user_meta_data->>'last_name',
            CAST(new.raw_app_meta_data->>'role' as public.role)
        );
    return new;
    end;
    $$ LANGUAGE plpgsql SECURITY definer;
    When I create a new user the first_name and last_name that I pass through options are not copied over to public.user, even though they exist in auth.users table const handleRegisterUser = () => { supabaseClient.auth.signUp({ email: 'foo@gmail.com', password: 'password', options: { data: { firstName: 'John', lastName: 'Doe', }, }, }) }
    g
    • 2
    • 2
  • Netlify functions issue
    a

    anthony-BH

    02/09/2023, 9:27 PM
    Hello I am having an issue calling a database function using Netlify functions. My code for the Netlify function is below:
    Copy code
    const {createClient} = require('@supabase/supabase-js')
    const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_KEY)
    
    exports.handler = async event => {
      const {data, error} = await supabase.rpc('menu_json')
      console.log(data, error)  
    
      return {
        statusCode: 200,
        body: JSON.stringify({
          data: data,
          error: error
        })
      }
    }
    I get the following error:
    Copy code
    {
      code: 'PGRST102',
      details: null,
      hint: null,
      message: 'Content-Type not acceptable: application/json, text/plain'
    }
    Any help as to why its not working would be very much appreciated!
  • many-to-many tables
    c

    CheesyNeesh

    02/09/2023, 10:08 PM
    is there documentation on many-to-many tables in supabase? i have the join table and it works fine, but i'm trying to figure out how to have additional attributes in the join rows like a status thing. any ideas?
    t
    g
    • 3
    • 7
  • How to chain negation for textsearch?
    m

    Mathew

    02/09/2023, 10:09 PM
    Hi there, I have a textsearch function that searches through a JSON object to find results that include certain words, and I'm trying to use the negate function to exclude certain results that match certain words, but it doesn't seem to be filtering out those results. I'm using the JS library, how should I be stringing together the negation? I've tried all of the following:
    'tourist attraction' | 'museum' & !'rental' & !'agency' & !'operator'
    'tourist attraction' | 'museum' & !'rental' | !'agency' | !'operator'
    'tourist attraction' | 'museum' & (!'rental' | !'agency' | !'operator')
    None of these seem to return results that match
    tourist attraction
    or
    museum
    but filter out ones that include
    rental
    ,
    agency
    or
    operator
  • Low code frontend tool / library
    m

    mchadwick

    02/09/2023, 10:18 PM
    Hey, I wondered if anyone has come across/knows of an easy-to-use tool library for creating a frontend that uses the API created by Supabase? The integrations in the docs all seem to connect directly to the DB, but I'd rather have something that used API and API gateway. It doesn't have to be low code, I am not a developer but fairly technical, I would just like something where it handles the data connection and I tell it the components i'd like to display and it look half decent. I tried react admin but the supabase connector seemed unloved. Any ideas suggestions would be much appreciated. Thanks!
  • Trigger to email. Already configured the function with supabase-mailer
    p

    petoma

    02/09/2023, 10:24 PM
    I am sorry if my question is obvious but I am just a beginner trying to get to trigger an email when an new row is added in one of my tables. I have followed the guide from supabase-mailer and I believe I am almost there. - First I configured my Sendgrid account and retrieve my API Key. - Then I prepared my Supabase project to have my API Key with:
    Copy code
    CREATE SCHEMA IF NOT EXISTS private;
    CREATE TABLE IF NOT EXISTS private.keys (
        key text primary key not null,
        value text
    );
    and
    INSERT INTO private.keys (key, value) values ('SENDGRID_API_KEY', 'aaaaaaaaaa');
    - Then I have added the send_email_message that is here: https://github.com/burggraf/supabase-mailer/blob/main/02_send_email_message.sql - Finally I have added the send_email_sendgrid that I have here: https://github.com/burggraf/supabase-mailer/blob/main/02B_send_email_sendgrid.sql So far so good. If I try the code:
    Copy code
    SELECT public.send_email_sendgrid(
      jsonb_build_object(
        'recipient', 'example@email.com',
        'sender', 'sender@email.com',
        'subject', 'Prueba de correo electrรณnico',
        'text_body', 'Texto de cuerpo',
        'html_body', '<p>Cuerpo HTML</p>'
      )
    );
    I receive the email. Thing is that I want the function to be triggered when a new row is added in one of my tables. I have the table "events" which has a field with a foreign key "user_id" which is linked to my table profiles where I can find "user_email". That would be the recipient. How could I create that trigger? When I try to create it with the UI in Supabase, the function is not listed because it does not return a trigger but JSON. Thanks!
    g
    • 2
    • 20
  • AuthApiError: invalid claim: missing sub claim
    l

    Le0n

    02/09/2023, 10:51 PM
    Hey guys, I just started using supabase for my react app. Now I want to get the user from supabase when I enter the website to store some things in a state variable. My code looks the following:
    Copy code
    tsx
        useEffect(() => {
            supabase.auth.getUser().then((response) => {
                console.log(response)
            })
        }, [])
    g
    • 2
    • 5
  • Project id?
    d

    DDupasquier

    02/09/2023, 11:06 PM
    Trying to set up CLI, but can't find anything in the UI called "project ID"
    g
    • 2
    • 4
  • RPC column reference is ambigous
    m

    mansedan

    02/10/2023, 1:28 AM
    Hey we are creating a function that creates successfully but running into an issue when calling it. We are getting a response: "Failed to run sql query: column reference "league_name" is ambiguous" The function creates with no errors:
    Copy code
    sql
    create function leagues_by_date(start_date DATE, end_date DATE)
    returns table (league_name TEXT, count integer) as $$
    BEGIN
      return QUERY select league_name,COUNT(*) as count
            FROM events
            WHERE date_event BETWEEN start_date AND end_date
            GROUP BY league_name
            ORDER BY league_name Desc;
    END
    $$ language plpgsql;
    Then we call it like this:
    Copy code
    sql
      select * from leagues_by_date('2023-02-08', '2023-02-09')
    Can anyone spot the error here for me? The league_name column is defined as 'text' in the table.
    g
    • 2
    • 16
  • Insert file csv or excel into an existing table
    s

    sinrabo

    02/10/2023, 3:16 AM
    Hello guys . I have a file data how can I import it into an existing table?
    g
    • 2
    • 6
  • I was messing around with API calls, and now my project is completely stuck "pausing"
    d

    doug3465

    02/10/2023, 3:56 AM
    My project that is a direct pipeline to the frontpage of my website is broken! Can anyone at Supabase help me hard reset my project? Can't get into any page and it's just a loading circle "pausing" everywhere.
    g
    • 2
    • 6
  • tried uploading audio blob to storage bucket but the audio file is empty
    v

    Vince

    02/10/2023, 4:10 AM
    I've seen how Supabase storage could be used to upload other forms of media files but I couldn't find an example of how a streamed media blob could be uploaded to storage properly. Basically in my app, I recorded/streamed audio chunks and after I stopped recording, I got the generated blob URL and the audio blob itself. In the past, I was able to upload the blob to Firestore with no issues, and I've also entered the base64 blob URL into Chrome and I could listen to the audio as well. However, when I ran the code below, the audio gets added to storage as an empty audio file, i.e., duration is
    00:00
    . Anything wrong with the code I used below?
    Copy code
    if (blob != null) { // base64 streamed audio blob
        const blobResponse = await supabase.storage
           .from("my-storage-bucket")
           .upload(mediaBlobUrl + '.wav', blob, { contentType: 'audio/wav' }); // mediaBlobUrl is the blob url generated
    Screenshot is attached as well as seen in the storage bucket.
    g
    • 2
    • 18
1...126127128...230Latest