When updating user with a hashPassword hook, the password gets rehashed
See original GitHub issueThis is how my controller looks like:
const user = await auth.getUser()
user.profile_pic = 'somethingnew.png'
await user.save()
return user
When I do this the hashPassword hook hashes the old password. How can I prevent this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
security - Updating password hashing without forcing a new ...
I would suggest adding a new field, "hash_method", with perhaps a 1 to signify the old method and a 2 to signify the...
Read more >PasswordHasher updating user information - Stack Overflow
So I am assuming the user data is used to hash the password and then to verify. But doesn't this mean I need...
Read more >PHP Password Hashing tutorial (with examples)
In this tutorial I show you how to perform PHP password encryption. You will learn how to use password_hash() and password_verify(), ...
Read more >PHP Native password hash – WordPress plugin
Passwords already hashed in the database will be rehashed automatically and transparently the next time the user logs in. PHP might come up...
Read more >Password Hashing and Verification (Symfony Docs)
This means that if a better hash algorithm is supported on your system, the user's password should be rehashed using the newer algorithm...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, exactly as @webdevian said. You can check for
$dirty
fields.I couldn’t find this in the docs