#Supabase User Profile Creation on App Sign-up - Full walkthrough

preview_player
Показать описание
In this episode I will show you a fantastic technique that will take your application to the next level when new users sign up to your app. With #Supabase, not only can you create an account seamlessly, but it's also the perfect opportunity to set up a detailed profile for each user.

In this video, we'll demonstrate how to utilise a trigger that constantly monitors the user table, ensuring that as soon as an account is created, a corresponding profile entry is automatically generated. This profile row is uniquely identified by the user's ID, providing a dedicated space to store all the extended profile information within our application.

To ensure good security, we'll implement a set of policies that lock down our profile table. This guarantees that only authenticated users have read and update access to the data, protecting the privacy of our users and their valuable information.

As an added bonus, we'll also demonstrate how to include a social media username as the display name in the profile table. This feature adds a personal touch to each user's profile and enhances the overall user experience.

In this video, we'll be using a #nocode #FlutterFlow project as our example. However, rest assured that this powerful technique can be applied to any front-end stack you prefer. So, let's dive in and unlock the full potential of your application together!

00:00 Introduction
00:49 What problem are we trying to solve!
01:23 Creating the profile table
03:36 Order of events
04:27 Creating the Supabase function
07:07 Creating the Supabase trigger
08:35 Creating a user to test our profile entry
09:41 Implementing RLS on the profile table
14:25 FlutterFlow Quick Test
15:25 BONUS: Social display name entry
17:25 Outro

_____

(official launch in September, but welcome to join today 😉)

🎉 Your love is much appreciated ... A like to this video is like a High Five!!! Thank you all.
Рекомендации по теме
Комментарии
Автор

Here's step-by-step to fix the Auth.Users table not showing when you select trigger.
TLDR: Supabase thought the users table was too important to let you edit it through their UI so they changed it. You can only access it through code. But don't be afraid!

1. On the left side bar, click SQL Editor (third icon from the top)

2. Copy and paste this into your editor :

create trigger new_user_trigger
after insert on auth.users for each row
execute function create_profile_for_new_users ();

Note : your function have to be called create_profile_for_new_users like it stated in the video.
I used Supabase AI to on the SQL Editor (The green bar) to generate the code. Here was my prompt "create a trigger in Supabase that reacts to new user sign-ups by inserting a row into another table called Profile".

Hope this helps!

lucashyde
Автор

Thanks, way more helpful than all the other stack overflow answers i found

timmyfrank
Автор

Thank you very much Steve for this tutorial, it was exactly what I was looking for! Straight to the point!

themafisk
Автор

very amazing ! Very clear and full of useful knowledge, thanks

kylekhanh
Автор

Thank you for the effort and clarity in these videos! Super helpful.

craigschrickker
Автор

Best tutorial!!👍👍👍thanx for the great video

swh
Автор

Is there any Update on this? I needed to select the auth table in the trigger UI. Only my public tables were available and not anything else! Is there a reason I can't make triggers from any of the locked schemas?

xzatech
Автор

Wow!! Excellent tutorial on Supabase. I have couple of questions. I watched your other series on “Goals tracking” app where you went over creating tables on Supabase at the beginning for creating accounts. Only this time, the difference is you created a “Function” and “Trigger” on Supabase. Do I need to create this “Function” and “Trigger”? Wouldn’t FF populate this automatically when you create an action to insert user details in table fields when user signup?

delwarhussain
Автор

7:17 as of today, supabase does not allow to add new trigger in the auth schema, how to solve this ?

AldrichCarrasco
Автор

Crazy that you can’t even put triggers directly on the auth schema anymore! but I get it. Was probably causing issues. Gotta learn about webhooks now I guess

Ncoherent
Автор

Thank you so much: How can I create an email confirmation flow with supabase and flutter?

AdeleCharlesMisstengeitGatuje
Автор

Hi, Can you also explain how to add the user in the storage bucket and delete the folder when the user is deleted

Llytkm
Автор

Hey there thanks for the amazing video
I got this error after creating the trigger when I want to add user:
_Failed to create user: Database error creating new user_
what should I do?

MAXX_P
Автор

I keep getting errors trying to create the function - undefined variable for public.profile I've checked spelling over and over, no clue what's causing this.

jackepner
Автор

Cannot find how you set up the username input action in this video, please advise. 😊

markh-thai
Автор

So much has changed on the Supabase end of things I didn't get that to work....

Good-and-Geeky
Автор

Now I wonder How can I get the First and Last names from the TextFields on my SignUp Page from FF into the profile table Supabase.

xzatech
Автор

have you something to delete the user in profile and in auth in the same time?

soulslord
Автор

I love your tutorials! I've just begun watching this, but I don't see any reference to deleting users. This is something that is not discussed in any videos that I've watched so far :)
I have lots of test users with no clue as to how to delete them.

dsl_art_studio
Автор

I cannot see auth -> users table in trigger settings (creation)

mrAAATriple