The error indicates that the password variable in the resetPassword function is undefined, causing the crypto.createHash("sha256").update(password) call to fail. This is because the crypto.update() method expects a string, Buffer, TypedArray, or DataView, but it's receving undefined.