简体   繁体   English

如何在Node.js中将用户的电话号码设置为密码恢复选项

[英]How do I set up a user's phone number as a password recovery option in Nodejs

I'm working on a nodejs project, I used passportjs in nodejs to create a login system. 我正在开发一个nodejs项目,我在nodejs中使用了passportjs创建了一个登录系统。 Everything seems ok, but I do not know how I can go about password recovery so that in the case of a lost or forgotten password, you have the option to receive a text message (SMS) or voice call to recover your account. 一切似乎都还可以,但是我不知道如何恢复密码,因此,如果丢失或忘记了密码,您可以选择接收短信(SMS)或语音电话来恢复您的帐户。

I want trying How To Implement Password Reset In Node.js , but the example there show password recovery via email. 我想尝试如何在Node.js中实现密码重置 ,但是那里的示例显示了通过电子邮件恢复密码。

I have checked this Stackoverflow questions already, but none of them helps in what I plan to archive: 我已经检查了这个Stackoverflow问题,但是它们都对我计划存档的内容没有帮助:

I will greatly appreciate any help. 我将不胜感激任何帮助。

Thank a million in advance. 预先感谢一百万。

Disclaimer, I do not have experience in Nodejs and this is a rough example. 免责声明,我没有Nodejs经验,这是一个粗糙的示例。

Find a service that can send texts to users such as twilio. 查找可以将文本发送给用户的服务,例如twilio。 Generate an authentication code using a random generator when user presses button. 用户按下按钮时,使用随机生成器生成身份验证代码。 Use that authentication code as a key to a map where the value is the user. 使用该身份验证代码作为值为用户的映射的密钥。

Then when the user inputs the code you can lookup the User to reset using the map created before. 然后,当用户输入代码时,您可以使用之前创建的地图查找要重置的用户。

The map you would want to store in your database. 您要存储在数据库中的地图。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何查看 JavaScript 中有效用户的电话号码? - How can I check a valid user's phone number in JavaScript? 我如何使用 firebase auth 在 nodejs 的服务器端验证用户电话号码 - How can i authenticate user phone number on server side in nodejs with firebase auth Mercury-如何设置选项元素的“ selected”属性? - Mercury - How do I set an option element's 'selected' property? 如何设置用户不能在第一个数字中输入数字0? - How do I set the user can not enter the number 0 in the first number? FIREBASE phoneAuth (LinkWithPhoneNumber)。 稍后如何在 Firebase Web 中更改用户的关联电话号码。 ( nodejs, Create-react-app )? - FIREBASE phoneAuth ( LinkWithPhoneNumber ) . How to change a user's linked phone number later in Firebase Web. ( nodejs, Create-react-app )? 如何使用javascript验证电话号码? - How do I validate a phone number with javascript? 如何通过购买次数设置标记的尺寸? - How do I set a marker's size by a number of purchases? 尝试使用 nodemailer 在 nodejs 中设置密码恢复 - trying to setup password recovery in nodejs using nodemailer 如何在使用电话号码注册期间将名称和 email 添加到 Firebase 用户帐户? - How do I add name and email to a Firebase user account during signup with phone number? 如何设置nodejs服务器,通过检查URL为客户端提供正确的文件? - How do I set up a nodejs server that gives the client the correct file by checking the url?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM