今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
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,…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
(已锁定)
The basic password reset process2 分钟 3 秒
-
Adding a forgot password page7 分钟 48 秒
-
(已锁定)
Sending a reset password email7 分钟
-
(已锁定)
Creating a reset password landing page8 分钟 34 秒
-
(已锁定)
Handling password reset success and failure3 分钟 13 秒
-
(已锁定)
Adding a reset password server endpoint5 分钟 29 秒
-
(已锁定)
-
-
-
-