M
M
Mikhailo Poberezhny2017-04-11 14:54:56
Node.js
Mikhailo Poberezhny, 2017-04-11 14:54:56

How to switch from meteor accounts-password to plain bcrypt?

We need to move from meteor to express 4. Now the task is to move away from the meteor accounts-password package and move to bcrypt (since accounts-password is based on bcrypt). The problem is that bcrypt and accounts-password generates a hash similar in structure to me, but it still does not pass bcrypt.compare. Please tell me how to fix it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BiSeTrojanov, 2019-12-07
@BiSeTrojanov

In Meteor JS, the password is first hashed with SHA-256 before being sent to the bcrypt_compare function , so your code should look something like this

password_verify(hash('sha256', $password), $bcrypt_hash_from_db)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question