https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Restore SQL executing out of order, causing FK errors and an unsuccessful run
    s

    sergiofra98

    03/08/2023, 7:59 PM
    I have generated an SQL restore file using
    pg_sample
    , when I try to restore the file using STDIN it seems to execute out of order and spit out FK errors, any ideas to why this happens only on a deployed database and not on local development?
  • import type { PageData } from './$types' does not work
    j

    JackBiscuits

    03/08/2023, 8:45 PM
    Hello, I get the following error when i follow the Auth tutorial: "Build a User Management App with SvelteKit": [plugin:vite-plugin-svelte] /src/routes/+page.svelte:15:13 Unexpected token /src/routes/+page.svelte:15:13 15 | import type { PageData } from './$types'; ^ Why is PageData an unexpected token?
    s
    b
    j
    • 4
    • 41
  • Permissions denied on trigger
    t

    Trevvy

    03/08/2023, 9:36 PM
    I have a trigger that creates a profile row automatically after the user signs up. Here is the trigger:
    Copy code
    sql
    BEGIN
      INSERT INTO public.profiles (user_id, name)
      VALUES (new.id, new.raw_user_meta_data->>'name');
      RETURN new;
    END;
    However, in the logs I'm getting this error: ERROR: permission denied for table profiles Now because I created the trigger as Admin, I thought that I would have all rights and bypass RLS?
    g
    v
    • 3
    • 12
  • Decrease Delivery Time of Supabase Magic Link (OTP) Email
    j

    jakeAnon

    03/08/2023, 10:03 PM
    Hello, I have an application utilizing supabase Magic Link to provide a otp passcode for verification purposes. Sometimes the email can take a couple of minutes to appear in my inbox and users have noticed this as well. Is there anyway to decrease the delivery time? I should note that I am on the free plan, is there prioritization in place for paid plans?
    g
    • 2
    • 8
  • User Auth Flow / Password Recovery
    z

    zavbala

    03/08/2023, 10:19 PM
    Hello fellas, I am lost with the user auth flow. If you disable the "Allow new users to sign up" you can't register new users from any way ( script, form, ... ) but for my case I've disabled this option cause if the user doesn't exist Supabase sends an email to confirm it and then supabase allows the login, so the only available option is sending an invitation from Supabase's dashboard. If I choose the invitation way, how can I change the user password and its data from the supabase's website? What's the default password for new users? The above case is because I am developing a company dashboard, for a while just me will be able to create users. Easy, I wanna create users for my own, and I don't wanna supabase send the invitation email when "User doesn't exist yet" I hope my explanation be clear.
    s
    • 2
    • 5
  • Can't make postgres user superuser in new project
    y

    ymahmo

    03/08/2023, 11:04 PM
    Hi, I created a new project and restored the schema from another project (the prod version) using snaplet. But I can't seem to query anything on the new Dev project, im getting "permission denied for public schema" but can't update anything because the base "postgres" user is not a superuser and I can't grant myself superuser permissions. Any idea on how to get around this? Thanks!
    g
    • 2
    • 5
  • Auth version 0.9 not updating session
    j

    jar

    03/08/2023, 11:43 PM
    I made an auth flow for 0.8 with sveltekit and saw 0.9 and following guide https://supabase.com/docs/guides/auth/auth-helpers/sveltekit i have been using forms to build it out and have it to the point where I can verifyOTP and get successful login with accessToken and all that but the export let session does not update with my new user session. Is this something that one of these hooks files does or would i add something to my server signin action with result though i dont see them doing that in docs?
    s
    • 2
    • 8
  • failed to save database password
    j

    Jinni

    03/09/2023, 3:04 AM
    When linking a project, I get this error
    Copy code
    Failed to save database password: failed to unlock correct collection '/org/freedesktop/secrets/collection/login'
    It seems to succeed though. I am just "worried" I am not setting it up properly.
    s
    • 2
    • 4
  • Should I be using the project_id from the dashboard in my config.toml?
    j

    Jinni

    03/09/2023, 3:17 AM
    Should I be using the project_id from the dashboard in my config.toml?
    s
    • 2
    • 1
  • schema supabase_functions does not exist
    j

    Jinni

    03/09/2023, 3:27 AM
    When I try
    npx supabase start
    I get this error. I have a migration from a remote project.
    g
    • 2
    • 28
  • after updating email old email still exist
    b

    byod

    03/09/2023, 5:06 AM
    I implemented email update everything works fine,but after updating the email when i try to update the email with the old one it gives error that is "a user with this email address has already been registered " , how i can delete the old email so that i'll not get this error. I checked the auth user table, the email is updated there.
    s
    g
    • 3
    • 11
  • Thoughts on using RLS to prevent any row changes and only using RPC?
    d

    DanMossa

    03/09/2023, 5:36 AM
    I'm curious if there are any negatives to having RLS enabled with no rules and just creating security definer RPC functions to interact with on the client. This would prevent users from accessing anything I don't want them to since they can only interact with the database via RPC. Any negatives?
    s
    • 2
    • 1
  • Set custom api url instead of localhost
    j

    Jinni

    03/09/2023, 6:26 AM
    Is there an option in the config.toml that would enable me to set the api url to a custom one instead of localhost?
  • What should I prepare columns in the table to implement social login?
    m

    Masami Ogasawara

    03/09/2023, 7:41 AM
    Hello, I'm reading https://supabase.com/docs/guides/auth/social-login/auth-facebook. But I can't understand about DB. What should I prepare columns in the table to implement social login in Supabase?
    s
    g
    • 3
    • 16
  • How can I invoke a supabase edge function with a DELETE method?
    h

    hoj

    03/09/2023, 8:08 AM
    It says edge functions support the main HTTP methods - https://supabase.com/docs/guides/functions/quickstart#using-http-methods But how do I invoke different methods e.g. DELETE from the supabase client edge function invoke API?
    g
    • 2
    • 2
  • pg_cron not performing job
    v

    viktor

    03/09/2023, 8:45 AM
    I've enabled pg_cron in dashboard. And got the following test code
    Copy code
    sql
    SELECT cron.schedule(
                   'test-cron',
                   '34 8 * * *', -- crontab.guru (GMT)
                   $$ PERFORM public.test_cron() $$
               );
    
    CREATE OR REPLACE FUNCTION public.test_cron()
        RETURNS VOID
        LANGUAGE plpgsql
        SECURITY DEFINER
    AS
    $$
    DECLARE
    BEGIN
        UPDATE public.customer SET a_column = null WHERE public.customer.id = 1082;
    END;
    $$;
    
    ALTER FUNCTION public.test_cron() owner to postgres;
    
    -- I've also tested adding in this:
    grant usage on schema cron to postgres;
    grant all privileges on all tables in schema cron to postgres;
    I've double checked the database time with
    select now();
    If I do
    select * from cron.job;
    The job is there, username is postgres which is the same user that I can manually do this with
    select * from public.test_cron();
    And yes I've tried to replace PERFORM with select * from in cron job. So I'm a bit lost on what I'm missing.
    • 1
    • 2
  • inconsistent format when generating types
    j

    Jinni

    03/09/2023, 9:35 AM
    So I am setting up a github action to check the supabase types but it seems iconsistent.
    s
    • 2
    • 6
  • Is there a way to use NPM packages in Edge functions?
    g

    Guy Rozen

    03/09/2023, 9:53 AM
    Title pretty much says it all. I need a specific NPM package to be available within an edge function, is it possible to somehow import/install it? Because right now it seems like its impossible from several attempts.
    s
    p
    i
    • 4
    • 9
  • Password Reset Code
    u

    1nf

    03/09/2023, 10:17 AM
    In our situation it would be easier to use a time expiring code to reset password. How could I email one to a user, check if its valid and then reset the password using it? Thanks
    s
    • 2
    • 5
  • Localhost Default Project Page loading endlessly.
    a

    aaadryyy

    03/09/2023, 10:24 AM
    Hi! Newby open-source contributor here 👋 I'm trying to help on some github issues, but
    http://localhost:8082/project/default
    is loading endlessly. API calls:
    http://localhost:8082/api/projects/default/api/rest
    returns a
    404
    http://localhost:8082/api/pg-meta/default/query
    returns a
    400
    What can I do?
    g
    • 2
    • 2
  • How to automatically log a user out/destroy session
    p

    Philipp Lerche

    03/09/2023, 10:54 AM
    I want to implement a functionality for blocking users. Destroying the session in the database did not work. So i was wondering if there is any way to automatically log a user out?
    g
    • 2
    • 1
  • Multiple sessions per user?
    a

    Amalyth

    03/09/2023, 10:56 AM
    Hello, I've been looking for authentication for my android app. My clients will have multiple android devices that each have the app installed, and so I need a way to allow multiple logins or sessions per user. It would be great if I could control or limit how many sessions are allowed. I looked through Supabase but I'm not sure. Is this something that Supabase can do?
    g
    • 2
    • 14
  • Magic Link Template for two different purposes
    n

    NJ™

    03/09/2023, 11:30 AM
    I am using magic link for two purposes setting password and inviting to group. Is it possible in any way I can have different content for the both?
    g
    e
    • 3
    • 5
  • Use user = userUser() as global state variable
    s

    Solid Snake

    03/09/2023, 12:03 PM
    Hi, would it be possible to use user as a global state variable? The intent would be to add data to user, e.g. user.additionalData = "data" and then use it in other components. is this a stupid idea? Are there any drawbacks? Does useUser save data locally the first time only or does it make continuous requests to the internet? Thank you.
    b
    • 2
    • 3
  • Validating storage input
    j

    Jaaneek

    03/09/2023, 12:12 PM
    Can I somehow validate storage input when uploading from client? Doing stuff like checking for nudity, minimum size, formats etc.. IF I need to do it on server, what would be the best approach? Usually people are doing this on a client with presigned urls, is that an option on supabase as well? I'm pretty new to the topic so feel free to point out any mistakes In my thoughts example: https://twitter.com/t3dotgg/status/1564019039877271552?lang=en
    g
    • 2
    • 2
  • Session is undefined in NextJS
    m

    mintho

    03/09/2023, 12:42 PM
    How to make the session available in
    _document.ts
    . I want to show a log out button if session is not null
  • Restricting postgres remote access in Supabase (or other security layer)?
    h

    hko

    03/09/2023, 12:56 PM
    Currently, supabase seems to allow remote connections from anywhere with full database access using user
    postgres
    and the DB password. Is there a way to disable remote connections (or restrict to allowlist)? Alternatively, are there ways to improve security, like requiring the SSL cert (which is optional at this point)?
  • Magic link success, redirect passsing params to te URL using # instead of ?
    z

    zegoverno

    03/09/2023, 1:01 PM
    Is there a way to change this behavior?
    g
    • 2
    • 1
  • Read pgAudit logs inside dashboard
    r

    Ruben

    03/09/2023, 1:18 PM
    Did I configure something wrong or is there an additional step required to get the logs from pgAudit to show up in /logs/postgres-logs . I followed your simple instructions for pgAudit enabling but there is actually no mention of how to view the logs https://supabase.com/docs/guides/database/extensions/pgaudit (we also can't SSH in to tail the file itself)
    n
    • 2
    • 1
  • Importing csv fails
    d

    david1

    03/09/2023, 1:22 PM
    Hi, I'm trying to import a CSV file through the Supabase UI, but it fails importing the whole file. I end up with a table that's only partly filled with data. The point at which it fails is different every time. The file has a bit under 3 million rows and it has failed anywhere between 500k and 1.5m. Attached is my browser console when the import fails. Can anyone help me with this?
    g
    • 2
    • 2
1...160161162...230Latest