tvallotton / rocket_auth

An implementation for an authentication API for Rocket applications.
https://docs.rs/rocket_auth/
Apache License 2.0
73 stars 35 forks source link

Check if String is same as hashed password #38

Closed ywegel closed 2 years ago

ywegel commented 2 years ago

I am currently implementing a feature to change a users password and email. To do that the user has to reenter the password, even if he is logged in. After that i want to hash the password and compare it to the current one. My Problem is: I can't find a method to easily hash a String with the same salt as the current password. For now i can try to use the argon2 crate as you do and hash it that way, but It would be nice to have a function to compare the hashed password to a string. Maybe you can add that in the next release :)

tvallotton commented 2 years ago

Hi, feel free to make a PR for it. Unfortunately I have been a little busy lately, so it make take me some time before I can take a look at this.

ywegel commented 2 years ago

No problem. If i have time i will try to implement it and make a PR

ywegel commented 2 years ago

This was implemented in fe538aa