课程: React: Authentication

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Sending a reset password email

Sending a reset password email - React.js教程

课程: React: Authentication

Sending a reset password email

- [Instructor] Okay, so we have our forgot password page, but in order for it to actually work, what we're going to need to do is define the route that it can actually send the user's email to. So this route, as we learned earlier, we'll basically check to see A, if there's already an account with that email address in our database, and B, if there is, it's going to generate a reset code and send it to the user's email address. And this is actually going to be very similar to what we did when we created the email verification route for our app. So let's open up our backend and inside our routes folder, we're going to create a new file for our route, and we're just going to call this route, the ForgotPasswordRoute.js, and here's what that route is going to look like. We're going to start off up at the top by importing a few things. We're going to import the UUID package which we'll be using to generate the region you set code.…

内容