课程: React: Authentication

今天就学习课程吧!

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

Rewriting the reset password endpoint

Rewriting the reset password endpoint - React.js教程

课程: React: Authentication

Rewriting the reset password endpoint

- [Instructor] Okay! The next step here is going to be to modify the resetPassword endpoint. And in this case, just like with the email verification flow, Cognito is going to be sending the user a six-digit verification code instead of a link, as we had it before. And we can actually verify this by checking our email and we'll see that we just got an email from that little test we did with a six-digit verification code. So, the next step now is to rewrite the resetPassword endpoint, that will basically take care of verifying that code and resetting the user's password if it's correct. So, on our backend here let's open up our resetPassword endpoint and here is what the changes are going to look like. So, just like before, we no longer are going to need bcrypt and we're not even going to need a connection to our database anymore, since Cognito again, is going to be taking care of that for us. And we're going to import…

内容