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

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