From the course: React: Authentication (2021)
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Adding an update user route - React.js Tutorial
From the course: React: Authentication (2021)
Adding an update user route
- [Tutor] So at this point, we have our signup and login pages both working, but as I'm sure you've noticed we have yet to actually make the main attraction of our app the user info page that is work. So let's take a look at how to incorporate the JSON web token logic that we've been using so far into this page as well. So the first step here is going to be to add another route to our backend. This is the route that the client will send requests to in order to actually modify the user's info. So inside our routes folder in our backend let's create another route. We'll call this route updateUserInfoRoute.js. And we're going to start off by importing a few things up at the top. We're going to import the JSON web token package. So import JWT from JSON web token. We're going to import something from the MongoDB package, right? It's going to be ObjectID. Don't worry too much about the details here. And we're also going to…
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
-
-
-
-
-
-
-