feat: implement password management system (#314)#460
Merged
devEunicee merged 2 commits intoJul 1, 2026
Conversation
- Migration 0005: user_credentials, password_history, password_reset_tokens, password_reset_attempts tables - passwordManager.js: bcrypt hashing (12 rounds), strength validation (12+ chars, upper/lower/digit/special), password history check (last 5), secure reset tokens (SHA-256 stored, raw sent via email), 30-min expiry, rate limiting (5 attempts / hour per identifier) - auth.js routes: POST /reset-request, /reset, /change - Session invalidation on reset (callers drop active sessions) - User enumeration prevented on reset-request (always 202) Closes devEunicee#314
|
@elenajoyce Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Implements a secure password management system with hashing, reset flows, and strength enforcement.
Changes
0005_password_management.sql—user_credentials,password_history,password_reset_tokens,password_reset_attemptsapi/src/services/passwordManager.js:validateStrength()— 12+ chars, uppercase, lowercase, digit, special charisPasswordReused()/recordPasswordHistory()— prevents reuse of last 5 passwordsgenerateResetToken()— 32-byte secure random, only SHA-256 hash storedvalidateResetToken()/consumeResetToken()— 30-minute expiry, single-usecheckResetRateLimit()— max 5 reset attempts per identifier per hourapi/src/routes/auth.js—POST /reset-request,/reset,/changeapi/src/server.js— registers/api/auth/passwordrouterAcceptance criteria
Closes #314