From the course: React: Authentication
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Adding JWTs to the user info page - React.js Tutorial
From the course: React: Authentication
Adding JWTs to the user info page
- [Instructor] Alright, so now that we've added this functionality to the signup page and login page, the next thing we're going to need to do in order to see this in action is actually add them to the user info page. And here's what this is going to look like. We're basically going to need to use the useUser custom hook that we created to load the user and basically pre-populate these values here, right? Favorite food, hair, color, bio, stuff that the user can edit with those values. So here's what this is going to look like. We're going to start off here, of course, by importing axios from axios. We might not use that right away, but that'll be around for when we need it. Then we'll say import useUser from the useUser hook that we created, alright? useUser. And then we're going to import use token as well. Now, we might not use this one yet, but this one will be around for when we want to do stuff like allow the user to log out. So just keep your eye on those. I'm just putting these…
Contents
-
-
-
What is user authentication?6m 48s
-
Basic project setup3m 20s
-
(Locked)
Creating private React routes8m 17s
-
(Locked)
JSON Web Token basics11m 29s
-
(Locked)
Solution: Working with JSON Web Tokens2m 43s
-
(Locked)
Adding a sign-up route to the server12m 20s
-
(Locked)
Generating JSON Web Tokens6m 9s
-
(Locked)
Adding a log-in route to the server4m 32s
-
(Locked)
Adding JWTs to the front-end4m 19s
-
(Locked)
Parsing JWT data4m 29s
-
(Locked)
Adding JWTs to sign-up and log-in pages5m 37s
-
(Locked)
Adding JWTs to the user info page9m 54s
-
(Locked)
Adding an "update user" route11m 47s
-
(Locked)
Adding update functionality to the front-end4m 49s
-
(Locked)
State management for tokens7m 18s
-
(Locked)
Adding log-out functionality3m 47s
-
-
-
-
-
-
-
-