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 an "update user" route - React.js Tutorial
From the course: React: Authentication
Adding an "update user" route
- [Instructor] All right, well now that we have our user info page at least partially connected to the server, the next thing that we're going to do is we're going to add functionality for allowing the user to edit these values. Now the reason why this is such a big thing here is because now that we have this token in place, we'll be able to have our server actually make sure that the user who, you know, just logged in is the only one who's able to edit this information, right? Because otherwise, you know, what really anybody could do is send a request to the right endpoint on the server and edit really any other user information in this case, and that's obviously not something that we want people to be able to do, is edit other users' information. So here's what this is going to look like. We're going to open up our backend again. All right, I'm just going to start sort of like with all of our editors closed, just to keep things clean, We're going to open up server.js, and we're…
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