Add Constraints on Passwords in Sign Up page #280
Merged
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.
Detailed Information
This pull request introduces password validation functionality to the signup page, ensuring that passwords meet specific security requirements. The changes include the addition of a new utility function for password validation and updates to the signup page to incorporate this validation.
Password validation functionality:
landing_page/src/app/lib/utils/RegEx.ts
: Added an enumerationPasswordRequirement
for the different password criteria, a typeTPasswordValidationResult
for the validation result, and a functionvalidatePassword
to check if a password meets the specified requirements.Updates to the signup page:
landing_page/src/app/signup/page.tsx
: Imported thevalidatePassword
function andTPasswordValidationResult
type.landing_page/src/app/signup/page.tsx
: Added statepasswordValidation
to store the password validation result and updated thehandleSubmit
function to show an error if the password does not meet the requirements.landing_page/src/app/signup/page.tsx
: Updated thehandleInputChange
function to validate the password whenever it is changed.landing_page/src/app/signup/page.tsx
: Added a list to display unmet password requirements below the password input field.Related Issues
Closes #277
Type of Change
Checklist (select as many as applicable)