https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • generate session on supabase edge
    m

    magicseth

    10/14/2022, 1:27 AM
    I'd like to generate a session jwt and pass it to my clients using a custom auth scheme. The tokens I'm able to generate are rejected on the client when I call setSession saying that the session isn't set: AuthSessionMissingError: Auth session missing! What should I put in the token to assuage this error?
    g
    • 2
    • 3
  • Auth UI does not redirect after login
    u

    user8923

    10/14/2022, 4:20 AM
    The Auth UI React component does not redirect me after login, despite the
    redirectTo
    attribute being present. Here is how I call the component:
    <Auth supabaseClient={ supabase } redirectTo={ "http://localhost:3000" } appearance={ { theme: ThemeSupa } } />
    I tried many forms for the
    redirectTo
    option, including with an ending slash. In the console,
    http://localhost:3000
    is my Site URL, and is also present in the Redirect URLs list. The authentication happens but the redirect doesn't.
    t
    • 2
    • 3
  • withPageAuth redirects back right after sign in?
    s

    Shelby

    10/14/2022, 6:12 AM
    Hi, Nextjs Auth Helper withPageAuth redirects back to log in page right after the user log in and get router.push to the dashboard.
    u
    n
    +2
    • 5
    • 12
  • Yesterday my auth was working, now not
    s

    Solemensis

    10/14/2022, 8:21 AM
    It gives this error rn, is it me done something wrong in code late night, or is it supabase i don't know
    g
    s
    w
    • 4
    • 8
  • Intermittent Auth fail by Magic Link
    d

    Dil

    10/14/2022, 11:58 AM
    We have auth by magic link. About 10/15% of users experience a failed login. We keep thinking we can narrow this down to a group - ie IOS clients, or 'people who were in the system before, but have been deleted, and are trying to make a new account' - but none of these turn out to be real. The error is shown in the image, its URL is this: https://www.app.nw.localloop.network/api/routeLogin.json Any ideas?
    g
    d
    • 3
    • 4
  • uploading file to storage convert file to garbage
    v

    ven

    10/14/2022, 12:08 PM
    I am trying to upload a file using server side API in Nuxt and the formidable package. For some reason the file is converting to garbage on supabase here is my code
    Copy code
    const {fields, files} = response;
        const avatar = files.avatar;
        // creates a valid name by removing spaces
        const fileName = encodeURIComponent(
            avatar.originalFilename.replace(/\s/g, "-")
        );
        // renames the file in the directory
        fs.renameSync(avatar.filepath, fileName);    
        console.log(avatar)
        const avatarData = fs.readFileSync(fileName)
        const {data, error} = await client.storage
            .from("site")
            .upload("public/" + Date.now() + "-" + fileName, avatarData, {
                cacheControl: "3600",
                upsert: false,
            });
    • 1
    • 1
  • Supabase-like GUI for PostgreSQL?
    d

    davitykale

    10/14/2022, 3:02 PM
    This might be a strange question, but I absolutely love the simplicity and clarity of the Supabase dashboard. While I am unfortunately stuck using Google Cloud Platform for work, I am wondering if there are any tools that folks recommend for working with PostgreSQL that are close-to-as-nice as Supabase?
    g
    t
    • 3
    • 2
  • Is realtime supposed to work locally already?
    e

    enyo

    10/14/2022, 3:12 PM
    Now that realtime-js@v2.0.0 has been released, can I use it locally with the latest
    supabase-cli
    ? Anytime I try to track I get
    Could not update presence timed out
    g
    t
    • 3
    • 11
  • Can I create a separate user for ready-only access to the database?
    t

    thasmo

    10/14/2022, 3:48 PM
    I need read-only access for an external/third-party service. Would I be able to create a separate read-only user for the database? If so, how would I do that? Thanks!
    d
    • 2
    • 1
  • Considering using Supabase but need some answer to three question
    k

    kermitbaby

    10/14/2022, 4:38 PM
    a) how many people visit our IOS or Android App Store Page after viewing that piece of content b) out of those people who view the app store page, how many people actually download the app c) out of those people who actually download the app, can we track how many actually register for a free trial and then how many people end up converting to a paid customers after the free trial is over?
    d
    c
    • 3
    • 2
  • Is there a method to create a unique username when a user signs up?
    v

    Vik

    10/14/2022, 5:02 PM
    Essentially, right now when a user signs up a function triggers that creates a public profile for that user. The username is nullable so my initial thoughts were to create an onboarding flow where the user is asked to select a username. But, is there a way where I can create a unique username for the user using my function? This is how my function is structured right now:
    Copy code
    begin
      insert into public.profiles(id, username, join_date, private)
      values(new.id, SOMETHING, now(), false);
    
      return new;
    end;
    v
    g
    +3
    • 6
    • 29
  • Invoke Edge Fn from Postgres Fn
    a

    Arne

    10/14/2022, 6:01 PM
    Hi! Is it possible to call an edge function from Postgres?
    g
    • 2
    • 3
  • supabase-js query does not return anything locally
    t

    thasmo

    10/14/2022, 9:06 PM
    Running this locally ...
    Copy code
    js
    console.log(
      await supabase
        .from('projects')
        .select('*')
    );
    just prints ...
    Copy code
    json
    { error: null, data: [], count: null, status: 200, statusText: 'OK' }
    Am I missing something when setting up supabase locally? Database does exists, table with a single row too.
    d
    • 2
    • 2
  • How to get current user data server side (next.js middleware)
    d

    Deed

    10/14/2022, 9:30 PM
    Hi, I'm trying to make a nextjs middleware function that requires getting the current session on the server. This data is there client side and in local storage, but how do I access it via the server to use my middleware function? I was hoping to do something like this:
    Copy code
    export async function middleware(request: NextRequest) {
      const {data} = await supabase.auth.getSession()
      if (data) {
        return NextResponse.redirect(new URL("/", request.url));
      } else {
        return NextResponse.redirect(new URL("/unauthorized", request.url));
      }
    }
  • Are periods supported in key names of JSONB values?
    t

    towels42

    10/14/2022, 10:50 PM
    I'm storing the following shape of data in a JSONB type field:
    Copy code
    column
    --------------
    {
      "foo.domain.com": {...},
      "bar.domain.com": {...}
    }
    However, when I run a query like:
    Copy code
    client.from("table").select("column->foo.domain.com")
    or
    Copy code
    client.from("table").select("column->'foo.domain.com'")
    I get the result
    Copy code
    {foo: null}
    or an error
    Copy code
    PGRST100, details: unexpected "'" expecting "-"
    d
    • 2
    • 7
  • getserverSideProps withpageauth user undefined in nextjs subscription example and locally
    m

    michel

    10/14/2022, 10:51 PM
    Hello! As the title says I am currently setting up authentication for my app and I am using the NextJS Vercel Supabase Subscription example as a reference (https://github.com/vercel/nextjs-subscription-payments). I set up SignUp and SignIn and now meant to secure the Account page, but when I do that the user object remains undefined. I tried a bunch of things, but nothing really worked. I noticed that the example page is also not working, as evident here: https://subscription-payments.vercel.app/account The postgres response is a 406, which is happening, cause the user object is empty. UPDATE: This works fine right after I sign up as a new user, but fails thereafter
    u
    • 2
    • 1
  • Create database functions that return nested objects for relations
    c

    cryptosi

    10/14/2022, 11:37 PM
    I want to create a database function that, when called, will return nested values, eg.
    Copy code
    json
    { name: 'milk', categories: [ { name: 'food' }, { name: 'fridge' } ] }
    So the above has milk as the primary table and then it has categories as nested values being passed back.
    • 1
    • 2
  • What would cause project to be stuck pausing
    u

    user8923

    10/15/2022, 12:03 AM
    I've been trying to pause a couple project and the UI is stuck saying "pausing" but nothing happens.
    g
    m
    +2
    • 5
    • 21
  • Filtering results by foreign key via cURL request
    b

    Bomzelis

    10/15/2022, 12:06 AM
    Hello, I've just recently started with Supabase and RESTapi request and I've came across the issue where my results cannot be filtered by foreign key value. When I filter them with the same table column, everything works perfectly. However, once I try to filter it with a foreign key, it returns my filtered query in addition to unwanted data with NULL field instead of previous value. My example look like this: Table 1 - Orders SKU(same value as table 2) owner_foreign_key(FK) Table 2 - Vehicles SKU (same value as table 1) owner_name [array] example.supabase.co/rest/v1/orders?owner_foreign_key.owner_name=eq.{owner_name}&select=SKU,owner_foreign_key(owner_name) Maybe someone could point me to the right direction or assist me into filtering further to ignore the NULL values and only return the queried owner_name value. Thank you!
    g
    • 2
    • 2
  • Server auth without setAuth
    d

    DanM

    10/15/2022, 12:47 AM
    I have been trying to follow some examples of how to use supabase on the server for remix. To be clear I want to query as the user to take advantage of RLS. I’m able to log in fine and put the tokens in a cookie with no problem. The issue comes when trying to use the tokens to query the database. All the examples I find say to pass the token to the setAuth function and then query like you would on the client. The issue it that setAuth is not included in supabase-js v2. Am I missing it somewhere? I tried using set session and it gave me back a good response but the queries still don’t work. I’m really stuck on this hoping anyone has any suggestions.
    d
    g
    • 3
    • 7
  • Multiple sites, same project
    m

    mattposgate

    10/15/2022, 6:07 AM
    Hi All, Can someone give me a definitive answer on whether you can have two sites using the same supabase project with auth? This is not about whether it's production or development. I have a suite of company websites that must have a single auth solution, ie if you register on one site the user can also log in on the others - using the email/password solution. Thanks!
    i
    g
    • 3
    • 8
  • supabase.auth.session() Error
    t

    The Little Cousin

    10/15/2022, 7:22 AM
    Use to be using this function;
    Copy code
    const isSignedIn = () => supabase.auth.session()? supabase.auth.session() : false;
    I'm getting;
    Copy code
    Uncaught TypeError: supabase.auth.session is not a function
    It used to works few weeks ago! Has the function been changed?
    g
    • 2
    • 5
  • DBConnection.ConnectionError{message connection not available and request was dropped from queue
    i

    itisnajim

    10/15/2022, 8:30 AM
    after restarting the containers, new messages appear in the logs
    Copy code
    [POP] 2022/10/15 08:14:28 info - 0.0423 seconds
    time="2022-10-15T08:14:28Z" level=fatal msg="running db migrations: Migrator: problem creating schema migrations: CREATE TABLE \"schema_migrations\" (\n\"version\" VARCHAR (14) NOT NULL\n);\nCREATE UNIQUE INDEX \"schema_migrations_version_idx\" ON \"schema_migrations\" (version);: ERROR: no schema has been selected to create in (SQLSTATE 3F000)"
  • By when can we expect Supabase to upgrade to PostgreSQL 15?
    p

    Pragy

    10/15/2022, 8:02 AM
    Postgres 15 was released just a few days back, and has some awesome features! One major feature that I'm desperately waiting for is
    View
    with
    Invoker
    security so that the RLS works on views. Any timeline for the adoption of PostgreSQL15?
  • TypeError supabaseServerClient is not a function
    j

    jbergius

    10/15/2022, 8:19 AM
    Hey! I'm upgrading my supabase-auth-helpers from @supabase/supabase-auth-helpers to @supabase/auth-helpers-nextjs and I've follwed the migration guide. The problem I'm having is my getServerSideProps function that looks like this:
    Copy code
    const { data, error } = await supabaseServerClient(ctx)
          .from('vendor_connections')
          .select('*');
    But I get a 404 and Page not found with the following error message: TypeError: supabaseServerClient is not a function Has someone encountered the same problem?
    • 1
    • 1
  • passing json as parameter to rpc – size limit?
    g

    GaryLake

    10/15/2022, 9:22 AM
    I'm trying to do a lot of batch processing of data from another API into Supabase. Looping my json outside of the rpc call and inserting one row at a time is predictably slow (and wasteful in its nature), so now I've MVPed what I was trying to do, I'm looking at passing json in to the rpc as a parameter and looping inside the rpc. However, I was wondering if there's an actual limit on the request size you can make – i.e. how many kb/mb of json can I sensibly chuck into an rpc before I need to think about paginating my requests... Bear in mind I'm calling from an edge function but not with an end user to worry about... when's it going to fall over?: * There's a kb/mb limit on the request size you can make – don't send more than xxx kb/mb! * There's no limit on request size to .rpc() but you'll hit a memory limit of xxx kb/mb either on the edge function or the postgres function if you're building up big lumps of json * It's going to fail in ways you cannot image if you send more than xxxx I've done some testing and my payload is likely to be 10-15kb of json per call day to day as I only grab data updated since last run. However, on first run or if a huge update has been made (which will be a few times a year), I'm imagining that I'll be wanting to try and process and insert anything from 200-300kb of json or maybe more!?
    d
    • 2
    • 2
  • SignUp not working
    w

    wilkijg

    10/15/2022, 2:06 PM
    Been having issues with SignUp which had previously been working. The error is simply: 'AuthApiError: Error sending confirmation mail'. Really stumped on what the issue is, tried everything I can think of.
    s
    g
    • 3
    • 5
  • Supabase interface `Failed to...
    j

    jpp244

    10/15/2022, 3:54 PM
    Hello when I am using chrome I keep having same kind of error message : "Failed to" I am not able to change any field on https://app.supabase.com/project/xqvnyjaddsmowbcshvlp/auth/settings
  • Custom SMS Authentication
    r

    revilo

    10/15/2022, 4:14 PM
    I have one problem, the auth in supabase has support for 3 mobile sms providers twilo and the rest. How do I achieve OTP authentication without using the options provided by supabase
  • Storage bucket return old data
    t

    talpiven

    10/15/2022, 4:21 PM
    I update new image/* type file to the storage in my bucket and when I try to fetch again I get an old data("image file type"). From the pictures you can see I am looking for "0.5999443275351208.jpg" and I'm getting a different picture from what the dashboard shows me. The dashboard image is correct but return an old picture
    g
    • 2
    • 3
1...454647...230Latest