nsc-events-fullstack_31_143_password-reuse-validation#147
Open
nsc-events-fullstack_31_143_password-reuse-validation#147
Conversation
TVW96
approved these changes
Feb 2, 2026
Contributor
TVW96
left a comment
There was a problem hiding this comment.
I tested and the duplicate password was successfully declined. Good work!
You can move this out of draft and into review.
test_reuse_password.mov
E2E Test Results
|
NahomAlemu
approved these changes
Feb 19, 2026
Contributor
NahomAlemu
left a comment
There was a problem hiding this comment.
I confirm that this PR adds password reuse validation to prevent users from setting their new password to their current password. The backend now checks if the new password matches the current one in both resetPassword and changePassword flows, throwing a BadRequestException with a clear message. The tests were updated accordingly, though there are some commented-out lines that should be removed for cleaner code.
password_pr.mov
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary & Changes 📃
Resolves: Missing Password Reuse Validation #143
Summary: (Briefly describe what this PR does)
This behavior results to:
redundant password hashing & higher compute usage,
unnecessary write operations & increased database transaction volume.
Repeated no-op(no operation) password updates create unnecessary load on the database, increasing compute, storage, and replication costs in managed services like AWS. At scale, this behavior inflates infrastructure costs without improving security or user experience.
To prevent this, enforce a validation during password resets to block the reuse of current or previously used passwords.
👀 What is the expected behavior?
Validation checks will run accordingly and dialog will display Cannot use the same password when trying to reset with duplicate password.
🗨️ Any relevant technical details?
Changes:
Added password checks to see if the new password is the same as the current, if yes, display error and do nothing to db
A new task can be that keep a history of all the previous passwords and not allow users to use any of the old passwords
Screenshots / Visual Aids 🔎
📌 Required for: UI changes, layout updates, or bug fixes.
Expand ⬇️
[Screencast from 2026-01-31 23-50-11.webm](https://github.com/user-attachments/assets/70162c95-9310-446e-8f21-b2bd31121486)How to Test 🧪
Should see a message on the screen saying new password should be different than the current passoword
Checklist ✅