Async or Sync bcrypt function to use in node.js in order to generate hashes?

前端 未结 2 654
一生所求
一生所求 2021-01-05 05:38

I\'m currently trying to make authentication module for my project in node.js?

I\'ve already seen some examples of using bcrypt to generate hashes, i.e.

http

2条回答
  •  太阳男子
    2021-01-05 06:02

    You can't make an async call inside of a synchronous method. Try making a separate method to use when setting the password.

    I just submitted a pull request so someone's project that does exactly this. Check it out here: https://github.com/nickpoorman/CrowdNotes/commit/e268c80a9cacddbc0215bf0e2b7aa31c0a4c785f

提交回复
热议问题