https://supabase.com/ logo
Join Discord
Powered by
# help
  • s

    surya

    09/06/2021, 12:19 PM
    How many applications can I connect to 1 supabase project in PRO plan
  • a

    Andy | Spillhosting.no

    09/06/2021, 12:42 PM
    Is there any rate limit that could cause enotfound?
  • s

    silentworks

    09/06/2021, 12:59 PM
    You sure that constant name is correct? it says
    SUPABSEURL
    some letters seem to be missing.
  • a

    Andy | Spillhosting.no

    09/06/2021, 1:00 PM
    I'm 100% sure it's correct it works most of the time, but it fails randomly sometimes. Last hour it's been failing almost all the time is there any update or rate limit that could cause this?
  • s

    silentworks

    09/06/2021, 1:02 PM
    I don't think you would be rate limited unless you were creating quite a lot of connections in one go.
  • k

    kailoon

    09/06/2021, 3:15 PM
    Newbie here, especially on the RLS front. I am creating a nextjs app with stripe using the example template. Wondering what should I do if i want to have a public profile page for each user. Do I need to create a public profiles table? Or I can extend the users table? If I leave RSL disabled. I can still interact with the db via provided API using annon key right? Just that I have to limit the user capabilities using api route. Am I understand these correctly? Thanks in advance.
    s
    • 2
    • 2
  • u

    user

    09/06/2021, 4:20 PM
    Hi, Has anyone played around with the suggested "Next.js Subscription and Auth" example project? I'm trying to figure out how to define the redirect URL from the Stripe Checkout site, so I contacted Stripe, but we found out that it is within the code. Right now the Stripe checkout page redirect to
    VERCEL_URL
    environmental variable in the helpers.js file, which is the deployment URL, but that creates a bad experience for the users. For instance my domain is mathiass.io and when the user is finalising the purchase and decides to get redirected using the link where the arrow in the screenshot is pointing, they are ending up at the deployment URL which is similar to mathiass-io-1bdsf74wdfsfd65-mathiass.vercel.app. That means they are signed out, because they have never been to that URL before. An ideal outcome would be to get properly redirected to the account page, where they can confirm that they purchase went well. `export const getURL = () => { const url = process?.env?.URL && process.env.URL !== '' ? process.env.URL : process?.env?.VERCEL_URL && process.env.VERCEL_URL !== '' ? process.env.VERCEL_URL : 'http://localhost:3000'; return url.includes('http') ? url : `https://${url}`; };` Would adding a variable be a good solution, or is there a better way of fixing it?
  • f

    florian-lefebvre

    09/06/2021, 5:17 PM
    Hi I'm trying to update a row using the js client.
    Copy code
    ts
    const { data, error } = await supabase
              .from<Category>("categories")
              .update({ parent_id: id })
              .match({ id: el.id });
    But I get a 404 error. My
    categories
    table has 3 columns:
    id
    (int8, primary key),
    title
    (varchar) and
    parent_id
    (int8, nullable, foreign key that references the id of the same table). I have RLS like so:
    Copy code
    pgsql
    alter table categories enable row level security;
    create policy "Categories are viewable by everyone" on categories for select using ( true );
    create policy "Any authenticated user can insert a category" on categories for insert with check ( auth.role() = 'authenticated' );
    create policy "Any authenticated user can update a category" on categories for update with check ( auth.role() = 'authenticated' );
    create policy "Any authenticated user can delete a category" on categories for delete using ( auth.role() = 'authenticated' );
    So I don't understand what I'm doing wrong
  • f

    florian-lefebvre

    09/06/2021, 5:24 PM
    I am authenticated when doing the request of course
  • t

    Thomas B

    09/06/2021, 6:11 PM
    Heya, try adding a "using" also along with your check. πŸ™‚
    create policy "Any authenticated user can update a category" on categories for update using (auth.role() = 'authenticated') with check (auth.role() = 'authenticated');
  • m

    Michael Ketzer | streamgeist.com

    09/06/2021, 7:39 PM
    I'm having a similar issue, I tried using this policy but when I am not authenticated, it returns all rows. My policy for the table is set like this. Do you have any idea why this happens?
  • t

    Thomas B

    09/06/2021, 7:45 PM
    Try using
    auth.role()
    instead of
    role()
  • m

    Michael Ketzer | streamgeist.com

    09/06/2021, 7:47 PM
    The
    auth.
    is always removed when saving it...
  • t

    Thomas B

    09/06/2021, 7:50 PM
    Ah that's true, brainfart.. Kind of new to this myself - You are talking about it returning stuff (SELECT)?? Looks like you are editing an UPDATE operation? πŸ™‚
  • m

    Michael Ketzer | streamgeist.com

    09/06/2021, 7:51 PM
    Hmmm. I actually edit it for
    ALL
    , at least that was what I thought. I added it manually now as query for
    SELECT
    and selects do not allow `WITH CKECK`s. So I can only use the
    USING
    there. But yes, I want it for selecting
  • t

    Thomas B

    09/06/2021, 7:55 PM
    Does it work now then?
  • t

    Thomas B

    09/06/2021, 7:55 PM
    Ah wait, are you using realtime functionality? (your policy name indicates that)
  • m

    Michael Ketzer | streamgeist.com

    09/06/2021, 7:57 PM
    No no, I just have the same policy for all actions, SELECT, INSERT, UPDATE & DELETE. Not using realtime here. I added that policy only for select, and that did not work as well. When I was logged out, it returned all rows. I am wondering if that is maybe related to the schema that is "public"...
  • f

    florian-lefebvre

    09/06/2021, 8:00 PM
    Thanks it worked!
  • t

    Thomas B

    09/06/2021, 8:06 PM
    Hmm, have you verified that you are actually logged out (with
    auth.user()
    / or maybe changing the role text to something else than 'authenticated') ? And you are totally sure you are using the public key and not the service key, right? πŸ™‚ - Also, it should not have anything to do with the public schema.
  • t

    Thomas B

    09/06/2021, 8:06 PM
    Perfect buddy.
  • m

    Michael Ketzer | streamgeist.com

    09/06/2021, 8:08 PM
    Oh no... sorry for wasting your time πŸ˜„ You got it, I used the wrong key. No idea why I used that, but okay πŸ‘€
  • t

    Thomas B

    09/06/2021, 8:15 PM
    Haha, totally fair mistake (in development at least 🀣 ) - just had to narrow it down to the "bug". :p
  • m

    Michael Ketzer | streamgeist.com

    09/06/2021, 8:18 PM
    I was searching for that since 2 days πŸ˜… Almost finished my MVP and that was one of the last things I got to check. Thank you πŸ™
  • t

    Thomas B

    09/06/2021, 8:21 PM
    Haha wow, glad I could help you then. :p Good luck with your project buddy. πŸ™‚
  • m

    Michael Ketzer | streamgeist.com

    09/06/2021, 8:34 PM
    Thank you! πŸ™
  • t

    tinjaw

    09/06/2021, 8:38 PM
    The option to use a Magic Link to sign in is not showing in my Auth component.
  • t

    tinjaw

    09/06/2021, 8:38 PM
    What might I be doing wrong?
  • t

    tinjaw

    09/06/2021, 8:42 PM
    Got it hanging out, for now, at http://5ed952a4004b.ngrok.io/
  • u

    user

    09/06/2021, 8:49 PM
    Hello, I'm trying to go through the NextJS quickstart documentation. For the step adding the .env.local variables, do I just add .env.local as a file under the root of my project? I'm trying to do that but it doesn't appear to be working.
1...767778...316Latest