strengthened the validation in login and signup pages - #586
Open
anshujod wants to merge 1 commit into
Open
Conversation
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.
Title
Strengthen validation and UX feedback for login and signup forms (#580)
Summary
Closes #580.
Login and signup forms previously only validated on submit — a user could fill in every field wrong and get no feedback until they clicked the button, and the "email already registered" check only ran at the very end. This PR adds real-time, field-level validation with clear visual states:
.invalid) or green border (.valid) reflecting their current state, in both light and dark theme.profile.htmlwas reviewed but not changed — it only displays saved account details and has no editable form, so it wasn't in scope.Changes
js/auth.js: addedsetFieldValidityandattachLiveValidationhelpers; wired live validation intohandleLoginPageandhandleSignupPage; submit handlers now also set valid/invalid classes alongside existing error messages.css/auth.css: added.input-group input.invalid/.input-group input.validstyles (border + focus ring) for both light and dark mode.Before:

After:

Test Plan
login.html: leave email/password empty, tab through fields — inline error + red border appears per field without submitting.signup.html: repeat the same check for name, email, password, phone, location.signup.html, enter an email that's already registered and blur the field — "This email is already registered. Please log in." appears immediately, before submitting.index.html) still work unchanged.