I have a function CreateUser that takes an email and password from the body of the post request and hashes the password using argon2id.CreateHash(requestBody.password, argon2id.DefaultParams) then inserts the email address and hashed password into the database.
I have another function LoginUser that also takes the requestBody.password and uses argon2id.ComparePasswordAndHash(requestBody.password, database.password)
However the comparison always returns false and it appears that the hash created changes under different function scopes - how do I get round this issue?
I have a function CreateUser that takes an email and password from the body of the post request and hashes the password using argon2id.CreateHash(requestBody.password, argon2id.DefaultParams) then inserts the email address and hashed password into the database.
I have another function LoginUser that also takes the requestBody.password and uses argon2id.ComparePasswordAndHash(requestBody.password, database.password) However the comparison always returns false and it appears that the hash created changes under different function scopes - how do I get round this issue?