From bd29ba49bb74d6ddad5fcd14f47ac1ab3c0a14b7 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Mon, 11 Oct 2021 12:14:43 +0200 Subject: [PATCH] fix #3390: to make the document more consistent, insert into profiles instead of "users" (#3396) --- web/docs/guides/auth/managing-user-data.mdx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/docs/guides/auth/managing-user-data.mdx b/web/docs/guides/auth/managing-user-data.mdx index 09937479c92..d0affd2a189 100644 --- a/web/docs/guides/auth/managing-user-data.mdx +++ b/web/docs/guides/auth/managing-user-data.mdx @@ -83,7 +83,7 @@ Make sure you _NEVER_ expose this publicly. But it can be used on the server-sid ### Using triggers -If you want to add a row to your `public.users` table every time a user signs up, you can use triggers. +If you want to add a row to your `public.profiles` table every time a user signs up, you can use triggers. If the trigger fails however, it could block the user sign ups - so make sure that the code is well-tested. For example: @@ -93,11 +93,10 @@ For example: create function public.handle_new_user() returns trigger language plpgsql -security definer -set search_path = public +security definer set search_path = public as $$ begin - insert into public.users (id) + insert into public.profiles (id) values (new.id); return new; end;