【问题标题】:failing to compare hashed password password with bcrypt.js in node.js无法将散列密码密码与 node.js 中的 bcrypt.js 进行比较 【发布时间】:2020-08-09 04:42:01 【问题描述】: Here is my code which i used to login. I am using simple password 1234 but it still returning false 【问题讨论】: 标签: javascript node.js mongoose bcrypt 【解决方案1】: 谢谢大家,我使用异步方法首先使用用户输入的值来存储哈希值,而且当我刚刚使用 bcrypt.hash() 方法时,它既不能同步也不能异步,然后我生成了 salt 和 hshed 密码并使用同步方法来比较对我有用的密码 【讨论】: