https://supabase.com/ logo
Join Discord
Powered by
# javascript
  • r

    RichCorbs

    08/29/2021, 3:12 AM
    I think it is a timing issue because when I insert a short delay auth.user responds consistently as expected.
  • b

    burggraf

    08/29/2021, 3:17 AM
    The problem we are having now is a different one. Looks like an abuse or attack of some sort. They’re working through it now.
  • d

    Darkwebplayer

    08/29/2021, 3:20 AM
    Hey, I'm confused with supabase
    storage update
    function. Update function goes like this
    Copy code
    supabase
    .storage
    .from("bucketname")
    .update("file.extension",file)
    My doubt is how can i replace the existing file if its in a different file format(if i keep the same name and new file is in different format it gets unreadable right) , lets say initially it was 'png' now it is 'jpg' Is there a way i could update the file in storage with a different type?
  • w

    waptik

    08/29/2021, 7:24 AM
    Hey! Newbie here trying hands on supabase. Quick question about storage. For files in private buckets, are signedUrls the only way of getting valid public urls for files even after making the bucket publicly accessible using RLS?
  • c

    Crane

    08/29/2021, 8:33 PM
    it's quiet here
  • c

    Crane

    08/29/2021, 8:34 PM
    I was trying to get some help too
  • c

    Crane

    08/29/2021, 8:35 PM
    My question: How do I stay at localhost(127.etc) after logging using the link from email?
    b
    • 2
    • 3
  • c

    Crane

    08/29/2021, 8:35 PM
    My settings are: site url: a-domain.com Redirect URLs: a-domain.com, localhost(127.etc)
  • b

    burggraf

    08/29/2021, 8:58 PM
    Auth redirect
  • d

    danestves

    08/30/2021, 4:56 AM
    Hi guys i need help with something, i'm doing this in a NextJS API Route to call data from Supabase, but the data it's always empty, even while the table have data
  • d

    danestves

    08/30/2021, 4:56 AM
    I'm doing something wrong or something like that?
  • d

    danestves

    08/30/2021, 5:00 AM
    Never mind, i forgot to write policies!
  • a

    ajcwebdev

    09/02/2021, 12:23 AM
    I'm not sure if this falls under the category or "building help" or actual bug/issue (also not sure if this is a bug in Redwood, Prisma, or Supabase), so happy to open an issue if it makes sense. But I was wondering if anyone knows what's causing this error. I'm trying to run
    yarn rw prisma migrate dev
    , (which is basically just a wrapper around
    prisma migrate dev
    ): https://www.prisma.io/docs/concepts/components/prisma-migrate And I'm getting this error:
    Copy code
    Error: Database error
    Error querying the database: db error: ERROR: unexpected response from login query
       0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
                 at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:375
       1: migration_core::api::DevDiagnostic
                 at migration-engine/core/src/api.rs:89
    My Prisma schema:
    Copy code
    datasource DS {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    
    generator client {
      provider      = "prisma-client-js"
      binaryTargets = "native"
    }
    
    model User {
      id        Int      @id @default(autoincrement())
      githubId  Int
      handle    String   @unique
      email     String   @unique
      createdAt DateTime @default(now())
    }
    
    model Repository {
      id        Int      @id @default(autoincrement())
      githubId  Int
      fullName  String
      createdAt DateTime @default(now())
    }
    Redacted
    .env
    file:
    Copy code
    DATABASE_URL=postgres://postgres:password@db.xxxx.supabase.co:6543/postgres
    SUPABASE_URL=https://xxxx.supabase.co
    SUPABASE_KEY=xxx
    SUPABASE_JWT_SECRET=xxx
  • a

    ajcwebdev

    09/02/2021, 12:36 AM
    DT to the rescue like usual, sounds like I need to set the params for the prisma connection string. https://github.com/redwoodjs/redwoodjs.com/pull/785
  • e

    Evаn

    09/02/2021, 12:53 AM
    I hadn't heard of prisma yet, seems super neat!
  • j

    Jannik Wempe

    09/02/2021, 4:51 AM
    Hey all, quick question: I'd like to upload some files to storage. What is best practice? Somehow using a key + restricted permissions in the frontend (and thus exposing that key) or proxying the files to my own server and upload from there? Currently I am going with own api but maybe that additional complexity isn't necassary?
  • j

    jason-lynx

    09/02/2021, 10:25 AM
    i dont think there's a best practice, the docs also suggest that a key + restricted permissions (aka policies) is only one of the possible ways to get that done: https://supabase.io/docs/guides/auth#you-dont-have-to-use-policies if your api already works well enough then it should be fine to leave it as it is?
  • y

    ymahmo

    09/02/2021, 5:37 PM
    Hi! New to supabase here, how can I add more columns to my users table? I'd like to store more than just email and phone number on a user. Things like their name and other preferences. I also can't seem to reference any ID's on the user table from another table I made, as a foreign key. Is this possible? or will I still need to create me own table of users and track this information there?
    s
    • 2
    • 5
  • l

    loooke

    09/02/2021, 5:57 PM
    Hey, is there any way to send a session refresh_token with a from().select() query to my database
  • l

    loooke

    09/02/2021, 5:58 PM
    i've got a RLS statement that lets users only see their own content, but I would think sending a refresh token or id or something would be the only right way to do this
  • s

    Scott P

    09/02/2021, 6:47 PM
    The
    auth.uid()
    function handles this automatically, so as long as your RLS policy checks that, users will only be able to view their own rows
  • l

    loooke

    09/02/2021, 7:44 PM
    yeah, I figured it out with
    supabase.auth.setAuth
    ,
    auth.uid()
    still needed a supabase session to work with, which was stored in a variable
  • j

    Jannik Wempe

    09/03/2021, 5:27 AM
    Thanks for your answer. Doing it via my own lambda without exposing any key and without including any additional dependency currently feels better to me. And it is working fine 🙂
  • j

    Jannik Wempe

    09/03/2021, 5:29 AM
    Another quick storage question: How can I get the URL of the file pointing to supabase where the supabase account owner has to log in? I want to send myself a link of a file. It should not be public and a signed URL will expire at some point?
  • j

    Jannik Wempe

    09/03/2021, 5:30 AM
    I only can create the file of a bucket but not an individual file.
  • j

    Jannik Wempe

    09/03/2021, 5:33 AM
    Nevermind, it seems I can create a signed url being valid for 10 years 😄
  • m

    Michael Ketzer | streamgeist.com

    09/04/2021, 3:50 PM
    Hey there, I am using RLS and have it enabled all over. However, when I got no session, it returns all data. This shouldn't be happening, or should it? As soon as I am logged in, I only see data that is applying the RLS. I am USING
    (uid() = user_id)
    + WITH CHECK
    (role() = 'authenticated':: text)
    .
  • o

    octalpixel

    09/04/2021, 4:52 PM
    In terms of react native , whats the best way to use supabase and have local sync as well ? Add things to Ayncstorage and sync to supabase later ?
  • s

    silentworks

    09/04/2021, 5:43 PM
    There is nothing built into supabase for this as yet, you would have to handle this yourself at the moment.
  • y

    ymahmo

    09/04/2021, 10:46 PM
    Does anyone have the twillio sms auth setup in here? When I sign users in, i don't get the user object back. Anyone else experience this? Here's the same command from the docs:
    Copy code
    PHONE LOGIN
    let { user, error } = await supabase.auth.signIn({
      phone: '+13334445555'
    })
    I get logged in, the session comes back to me after the OTP verify. But nowhere do I get the user object. It returns null
1...151617...81Latest