fix: password minlength mismatch and add email validation#24
fix: password minlength mismatch and add email validation#24ankushchk wants to merge 1 commit intoalphaonelabs:mainfrom
Conversation
Made-with: Cursor
WalkthroughThe changes implement email format validation alongside enhanced password constraints at both client and server layers. Client-side validation includes email regex checking and password length verification (8+ chars) with early error handling. Server-side validation adds email format validation before user registration processing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@public/login.html`:
- Around line 76-77: The label for the password input is not programmatically
associated with the input; update the corresponding <label> element to include
for="r-password" so it links to the input with id="r-password" (this improves
screen reader/focus behavior), and apply the same for other form fields where
labels are missing a matching for attribute to their inputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: alphaonelabs/coderabbit/.coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f36cb254-09ba-458b-b5a7-010b04731264
📒 Files selected for processing (2)
public/login.htmlsrc/worker.py
Summary
minlength="6"tominlength="8"and placeholder to match backend's 8-char requirementapi_register) and frontend (client-side check before fetch)What was exactly wrong
Test plan
Summary
This PR fixes a password minimum length mismatch and introduces email format validation to improve user experience and data consistency.
Changes
Frontend (public/login.html)
minlengthand placeholder from "6" to "8" to align with backend requirementsBackend (src/worker.py)
api_registerusing regex pattern matchingImpact
These changes resolve the confusing user experience where the frontend suggested a 6-character password minimum while the backend enforced 8 characters, resulting in server errors. Users now receive consistent, upfront validation feedback on both the client and server side. Email validation prevents invalid email submissions, improving data quality and reducing unnecessary server requests.