Implement password recovery best practice

后端 未结 12 967
天命终不由人
天命终不由人 2020-11-30 18:25

I want to to implement password recovery in my web application.

I\'d like to avoid using secret questions.

I could just send the password by e-mail but I thi

12条回答
  •  臣服心动
    2020-11-30 19:21

    Here's an example of how someone did it with Node.js, basically generate a random token, an expiry time, send out the link with the token attached, have a reset/:token route that ensures a user exists with that token (which is also not expired) and, if so, redirect to a reset password page.

    http://sahatyalkabov.com/how-to-implement-password-reset-in-nodejs/

提交回复
热议问题