Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update using triggers section in managing-user-data.mdx #23690

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions apps/docs/content/guides/auth/managing-user-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ val metadata = user?.userMetadata

### Using 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.
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.

Example:

Expand All @@ -281,3 +280,11 @@ create trigger on_auth_user_created
after insert on auth.users
for each row execute procedure public.handle_new_user();
```

<Admonition type="tip">

If the name of your profiles table contains capital letters, you must put it in quotes, for example `public."Profiles"`. This is a [Postgres standard](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#:~:text=Quoting%20an%20identifier%20also%20makes%20it%20case%2Dsensitive%2C%20whereas%20unquoted%20names%20are%20always%20folded%20to%20lower%20case.), where unquoted names are always converted to lowercase.

You can troubleshoot any errors by viewing the [Auth logs](/dashboard/project/_/logs/auth-logs).

</Admonition>