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

    Prodigy7kX

    11/23/2021, 3:07 PM
    thats my function snippet, hope it helps:
    Copy code
    -- inserts a row into public.users
    create function public.handle_new_user() returns trigger language plpgsql security definer
    set
      search_path = public as $$
    begin
      insert into public.profiles (user_id, first_name, last_name)
      values (
        new.id, 
        new.raw_user_meta_data->>'first_name', 
        new.raw_user_meta_data->>'last_name'
      );
      return new;
    end;
    $$;
    -- trigger the function every time a user is created
    create trigger on_auth_user_created
    after
    insert
      on auth.users for each row execute procedure public.handle_new_user();
    j
    • 2
    • 4
  • s

    silentworks

    11/23/2021, 3:12 PM
    @User and @User please move this into a thread
  • p

    Prodigy7kX

    11/23/2021, 3:12 PM
    ok
  • w

    wiesson

    11/23/2021, 3:13 PM
    Is there a reason why the magic-link email has no template?
  • s

    Scott P

    11/23/2021, 3:35 PM
    My dashboard shows one
  • d

    D11-JohnWaring

    11/23/2021, 5:14 PM
    I've made a new schema and table via the Supabase UI sign SQL. But I'm unable to enable Replication for the new table as it doesn't show in the list. Are there permissions I need to apply to the new schema/table? Cheers!
  • w

    Wickey

    11/23/2021, 5:34 PM
    Hey everyone! I'm attempting to implement row level security, and coming from a mongo background this is confusing me! Say I have a table called "shop_locations" (id, name, shopID) and I can only insert the row if my user ID is stored in "shops_access" (id, userID, shopID).. Im not sure how you reference the about to be inserted shop Id when you're checking in the access table? I've googled for hours so any help would be much appreciated!!
  • w

    wiesson

    11/23/2021, 6:19 PM
    This is interesting - I can't see it lol - I have
    SMS Message
    ,
    Confirm Signup
    ,
    Reset password
    ,
    Change email address
    and
    Invite user
  • w

    wiesson

    11/23/2021, 6:22 PM
    Ah, interesting - "Enable Email Signup" needs to be active in the configuration, otherwise it is not visible.. I intention was to only allow login via magic the link, not have a signup
  • p

    prism0x

    11/23/2021, 6:34 PM
    https://app.supabase.io/api/login and other paths are down
  • s

    Scott P

    11/23/2021, 6:51 PM
    remove
    /api/login
    from the URL
  • p

    prism0x

    11/23/2021, 6:58 PM
    Works now
  • r

    ralanyo

    11/23/2021, 8:12 PM
    I'm trying to do a bulk insert with a variable like this
    Copy code
    testList = {date: '2021-11-27'}, {date: '2021-11-28'};
    
    async function insertTime(){
    const { data, error } = await supabase
      .from('test')
      .insert([
        testList
      ])
    
    }
    But it's only putting the first date in . Is there a better way to do this? Thanks in advance
  • g

    garyaustin

    11/23/2021, 8:17 PM
    Try testList = [{},{}] .insert(testList)
  • r

    ralanyo

    11/23/2021, 8:20 PM
    ah ha! it worked. Can't believe i wasn't seeing those brackets
  • r

    ralanyo

    11/23/2021, 8:20 PM
    Thank you!
  • r

    Rudi

    11/24/2021, 9:57 AM
    I am unable to create a new Supabase project atm. Every time i press "New project" from the dashboard and select an organization I end up on a 404 page.
  • r

    Rudi

    11/24/2021, 10:18 AM
    My work colleague is experiencing that same thing.
  • d

    D11-JohnWaring

    11/24/2021, 10:54 AM
    Found it in the docs (should have looked harder): https://supabase.com/docs/guides/auth#tips -- add a table to the publication alter publication supabase_realtime add table products; Just need to fix the permissions now for the schema/table.
  • c

    cjacton

    11/24/2021, 6:44 PM
    Does anybody know how to make a table in JavaScript that is populated by a Superbase table?
  • p

    pcav

    11/24/2021, 9:57 PM
    Supabase's session isn't refreshing correctly, when I call supabase.auth.user() after returning to the website following a time of inactivity, it's null until the next page refresh. Does anyone know how to gracefully solve this?
  • c

    chipilov

    11/24/2021, 10:03 PM
    there is a thread about this: "Access to supabase.auth.user() on initial load" - take a look at it, there is a workaround at the bottom of it
  • p

    pcav

    11/24/2021, 10:03 PM
    Yeah, I just found it, thanks!
  • p

    pcav

    11/24/2021, 10:03 PM
    Meanwhile an elegant solution wasn't found, right?
  • p

    pcav

    11/24/2021, 10:04 PM
    Wish there was some promise based solution...
  • c

    chipilov

    11/24/2021, 10:06 PM
    there are a couple of issue opened about it, you can track them if you want: https://github.com/supabase/ui/issues/291 and https://github.com/supabase/gotrue-js/issues/143
  • p

    pcav

    11/24/2021, 10:06 PM
    Alright, thanks. It seems to me that your solution was react based, I'm going to study it a bit better and make a more general one
  • w

    Wickey

    11/24/2021, 10:07 PM
    Hey everyone! I'm attempting to implement row level security, and coming from a mongo background this is confusing me! Say I have a table called "shop_locations" (id, name, shopID) and I can only insert the row if my user ID is stored in "shops_access" (id, userID, shopID).. Im not sure how you reference the about to be inserted shop Id when you're checking in the access table? I've googled for hours so any help would be much appreciated!!
  • p

    pcav

    11/24/2021, 10:10 PM
    Is your userID the authID or do you have a seperate users table?
  • p

    pcav

    11/24/2021, 10:11 PM
    If it's the auth id, user() in SELECT ( shops_access.userID (not sure of the field here) from shops_access where shops_access.shopID = shop_locations.shopID )
1...141142143...316Latest