Previous video:

🇺🇸Database setup (3/8)

Intro

Essential to the objectives of this course, we’ll be teaching you how to create a user account. Without further ado, let’s get started!

Content of the video

Creating an account ( - ) Redirecting to a project’s URL ( - )

Transcript

1. Creating an account

Hi everyone, in this video I'm going to explain how to create an account thanks to Supabase. I will specifically use the Supabase Auth node. This node corresponds to the management of user accounts.

I will show you this in the register page of our project. I've already configured the Supabase nodes in the previous video. As you saw in the first video, the graph resets all these variables when the user leaves the page. I already have variables errormessage, successmessage, emailpassword and confirmpassword. The register is what I'm interested in today.

You can see that the asynchronous aspect is handled by the variable "is loading". At the beginning of the graph, I want the application to be loading. Once everything is finished, I want it to stop. This is replicated automatically on the button, on its text and on the fact that it is disabled or not.

The graph also handles errors by checking that the box for the password is not empty or that the password and its confirmation are the same. What I'm interested in today is the account creation essentially. So you don't need to worry about that. For this, I'm going to use an action that comes directly from the "auth" node. I'm going to replace the debug with a call to an action from supabase auth.

This action is "create user with email and password". I put it here. It can take more or less time depending on your internet connection.

This explains the need for a loading time. The action has three parameters: email, password that you already know, and redirect to. I will connect these first two parameters to the variables to which they correspond : "email" and "password". The redirect to parameter will be useful to choose the URL to which you want to redirect your users when they receive a confirmation email.