From the course: React: Authentication (2021)
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Adding a sign-up route to the server - React.js Tutorial
From the course: React: Authentication (2021)
Adding a sign-up route to the server
- [Instructor] Now that we know the basics behind what JSON Web Tokens are and how they work, it's time to start adding some routes to our server that'll incorporate JWTs as a way to allow us to sign up users and log them in. First thing we're going to add to our server is a sign up route. So let's open up our backend and src and routes here. That's where we'll be creating it. And this is the route that our server will send a request to when a new user signs up and what the route'll do is it's basically going to create a new user in our database and send back a JSON Web Token containing the user's data. We'll see a little later on exactly how this is actually stored and used by the front end but for now, here's what it's going to look like. Let's start off by creating a new file for our route. And we'll just call it signUpRoute.js. And just like we defined our testRoute using this object, we're going to use the same…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is user authentication?6m 27s
-
(Locked)
Basic project setup6m 28s
-
(Locked)
Building a login page8m 54s
-
(Locked)
Building a sign-up page4m 36s
-
(Locked)
Creating private React routes4m 11s
-
JSON Web Token basics9m 22s
-
(Locked)
Adding a sign-up route to the server8m 10s
-
(Locked)
Generating JSON Web Tokens6m 10s
-
(Locked)
Adding a login route to the server6m 59s
-
(Locked)
Implementing JWTs on the front end7m 36s
-
(Locked)
Adding JWTs to sign-up page4m 29s
-
(Locked)
Adding JWTs to login page2m 11s
-
(Locked)
Adding an update user route6m 22s
-
(Locked)
Verifying JSON Web Tokens5m 17s
-
(Locked)
Adding JWTs to the user info page7m 29s
-
(Locked)
Adding logout functionality1m 33s
-
-
-
-
-
-
-