Bcryptjs.compare always returning false in React App
I am having trouble with Bcrypjs.compare() when run on a handle submit of a login form. The form is created using formik.
As the code below displays, when submitting username and passkey, it first finds the user in the databass, along with the stored hashed passkey and then also the stored salt.
The stored salt is used in the handlesubmit to hash the passkey input from the form before using bcrypt.compare() to compare the hashed input and the stored hashed passkey.
I console log both parts and recieve an identical code in each cases.
However our compare method still returns false.
Any ideas on what is gong wrong?