I manually store password in MongoDB and fetch the password info from mongoose to login as this is no user sign up module to store the password, there is only sign in module.
Is there any way that I can convert the already stored password into hash password?
I have read articles on password hashing but I found that most hash password during user registration and it's not an issue.
But how to hash already stored password in mongoose and store in db?
If there is any article that any one wants me to recommend or suggest me on my approach that will also be helpful. I'm still exploring if there is any option I find I will be updating.
I was able to hash password by editing the prestored password.
for this I used bcrypt:
const salt = await bcrypt.genSalt(10);
password = await bcrypt.hash(password,salt);
But the issue now I'm facing is I want to utilize that hashed password, so how can I recover hashed password.
Reason being I store my emailid and password in db so inorder to trigger mail, and I hashed password for security, but now what happens is since the password is hashed my mailtrigger is not working as it doesn't recognize the password.
So what could be done for it?