From the course: React: Authentication

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Adding a reset password server endpoint

Adding a reset password server endpoint - React.js Tutorial

From the course: React: Authentication

Adding a reset password server endpoint

- Okay, now that we have our password reset landing page, the only thing that we have left to implement in the reset password flow is the end point that we can send the new password and verification code to in order to actually reset the user's password. So here's what that's going to look like: Inside the routes folder, we're going to create a new file for this route, and we're going to call the route the resetPasswordRoute.js. Okay, we have our forgotPasswordRoute and resetPasswordRoute. And we're going to start off by importing a few things up at the top as usual. We're going to say import bcrypt. From bcrypt, we're going to be using this to hash the user's new password. And then the only other thing we're going to import is our getDbConnection function, so getDbConnection from db. And then our function is going to look like this. We're going to say export const, resetPasswordRoute, The path for this route,…

Contents