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

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