feature: implement strong password policy for signup and reset-password#92
Conversation
|
@Community-Programmer please review and merge. |
|
@Community-Programmer please review and let me know ✅ Updated based on review feedbackChanges made:
The password policy now matches the strength meter from PR #85 exactly. 🎯 |
There was a problem hiding this comment.
Changes Requested 🐈
This PR adds a strong password policy using Zod schemas for signup and reset-password routes, enhancing security and input validation. Reviews found minor bugs, missing documentation, and some code quality issues that need addressing to improve maintainability and clarity.
There are a few things I'd like to see addressed before we merge this:
Before merging
- Add comprehensive JSDoc comments for all public route handlers and schema files to improve documentation.
- Fix the import statement typo with the extra space to prevent module resolution errors.
- Correct the regex for repeated character detection and remove commented-out legacy validation code.
Findings breakdown (32 total)
4 high / 6 medium / 12 low / 10 info
Confidence: 90%
🔗 View Full Review Report — detailed findings, severity breakdown, and agent analysis
Reviewed by Looks Good To Meow — AI-powered code review
💬 You can interact with me directly in this PR:
@tarin-lgtm fix [any constraints]@tarin-lgtm explain [your question]@tarin-lgtm improve [focus area]@tarin-lgtm test [what to focus on]
🔒 Fixes #90
Summary
This PR implements a comprehensive strong password policy for user authentication to enhance account security across the Edulume platform.
Changes Made
New Files
server/utils/passwordValidator.js: Created a new utility module for password validation with comprehensive security checksModified Files
server/routes/auth.js:/signuproute to use strong password validation/reset-passwordroute to use strong password validationPassword Policy Requirements
The new password policy enforces the following requirements:
✅ Minimum 8 characters long
✅ At least one uppercase letter (A-Z)
✅ At least one lowercase letter (a-z)
✅ At least one number (0-9)
✅ At least one special character (!@#$%^&*...)
✅ Not a common/weak password (e.g., 'password', '123456')
✅ No sequential characters (e.g., 'abc', '123')
✅ No repeated characters (e.g., 'aaa', '111')
Validation Examples
❌ Passwords that will be REJECTED:
password→ Too commonPass123→ No special character, too shortPassword1→ No special characterPassword123!→ Contains sequential charactersPassss123!→ Contains repeated characters123456→ Too common, no lettersAbc123!→ Too short (only 7 characters)✅ Passwords that will be ACCEPTED:
MyP@ssw0rd!Secure#Pass123C0mpl3x!PassStr0ng&Secur3Implementation Details
Backend Validation
/signupand/reset-passwordendpoints