added logic for updating user profile plus other bug fixes

This commit is contained in:
Kwesi Banson Jnr
2026-03-16 16:41:32 +00:00
parent 9cd017fb9a
commit 72180de8e4
30 changed files with 1346 additions and 49 deletions

View File

@@ -0,0 +1,9 @@
Steps for Lazy Migration:
Add a Column: Add a hash_version or new_password column to your database to differentiate between legacy (MD5) and new hashes.
Update Login Logic:
User enters plaintext_password.
Check if password_hash is MD5.
If yes, check if (md5(plaintext_password) == stored_md5_hash).
If matches, compute new_hash = password_hash(plaintext_password, PASSWORD_DEFAULT).
Update database with new_hash and set hash_version to "new".
Handle Remaining Users: After a set period, force a password reset for any remaining accounts still using the MD5 hash.