From b3d09a7465c5ce52413eed3db0f8503322707e66 Mon Sep 17 00:00:00 2001 From: Piyush Vashistha Date: Thu, 12 Dec 2024 02:55:01 +0530 Subject: [PATCH 1/6] Add Validation For Password In Registraion Page --- frontend/src/pages/register.jsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/frontend/src/pages/register.jsx b/frontend/src/pages/register.jsx index f6d2a98..cf7176d 100644 --- a/frontend/src/pages/register.jsx +++ b/frontend/src/pages/register.jsx @@ -20,9 +20,13 @@ export default function Register() { whatsapp: "", }); const [profile, setProfile] = useState(null); + const [error,setError] = useState(false); const handleChange = (e) => { const { name, value } = e.target; + if(name == 'password'){ + validatPassword(value); + } setFormData((prevData) => ({ ...prevData, [name]: value, @@ -33,6 +37,18 @@ export default function Register() { setProfile(e.target.files[0]); }; + const validatPassword = (value) =>{ + const regexPatterns = [ + /[A-Z]/, // Uppercase letter + /[a-z]/, // Lowercase letter + /\d/, // Number + /[^\w\s]/ // Special character + ]; + const isValid = regexPatterns.every(regex => regex.test(value)) && value.length >= 6; + setError(!isValid); + + } + // const handleTechStackChange = (e) => { // const selectedOptions = Array.from(e.target.selectedOptions).map( // (option) => option.value.trim().toLowerCase() // Convert selected options to array of strings @@ -319,6 +335,7 @@ export default function Register() { onChange={handleChange} required /> + {error &&

"Password must be at least 6 characters long and include one uppercase letter, one lowercase letter, one digit, and one special character."

}
From ebac58b862e04b29f2e30f9c0c0f2b0e6da20de4 Mon Sep 17 00:00:00 2001 From: Abhilash Kumar <137639128+AbhilashK26@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:50:11 +0530 Subject: [PATCH 2/6] Update CONTRIBUTING.md --- CONTRIBUTING.md | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 150cd55..fce4620 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,10 +5,12 @@ - Select an Issue and get yourself assigned - Follow the below guidelines in this file to make proper PRs -1. **Fork the Repository** +1. **Fork the Repository** + Create a fork of this repository by clicking the "Fork" button at the top of the repository page on GitHub. -2. **Clone Your Fork** +2. **Clone Your Fork** + Clone the forked repository to your local machine: ```bash @@ -24,22 +26,42 @@ ``` 4. **Make Your Changes** + Write clean, readable, and well-documented code. Ensure that the code passes all tests and follows the project's coding standards. You can also attach a working video to demonstrate your changes. -5. **Commit and Push Your Changes** +5. **Commit Your Changes** ```bash git add git commit -m "Add YourFeatureName" - git push origin feature/YourFeatureName ``` +6. **Sync your forked repository with the original repository** + + Go to the forked repository on GitHub, click on "Sync fork" tab and update your forked repository with the original repository. + +7. **Pull from main branch of the forked repository** + + Before pushing your changes, always pull from the main branch of the forked repository. + ``` + git pull origin main + ``` + Resolve the merge conflicts locally if any. + +8. **Push your changes** + + Now push your changes to the remote repository. + ``` + git push origin feature/YourFeatureName + ``` -6. **Create a Pull Request** +9. **Create a Pull Request** + Go to the original repository on GitHub, click on the "Pull Request" tab, and submit your pull request. Include a detailed description of the changes you made and` why they should be merged. While making a PR, follow [Pull_request_template.md](Pull_request_template.md) to get your pull request accepted. -7. **Reporting Issues** +10. **Reporting Issues** + If you find a bug or want to suggest a feature: - Search Existing Issues: From 2f49a7b5a1de3e6526846f6537b2499966825fee Mon Sep 17 00:00:00 2001 From: Abhilash Kumar <137639128+AbhilashK26@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:08:21 +0530 Subject: [PATCH 3/6] Update CONTRIBUTING.md --- CONTRIBUTING.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fce4620..7b549dd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,6 +33,7 @@ ```bash git add + git status git commit -m "Add YourFeatureName" ``` 6. **Sync your forked repository with the original repository** @@ -46,21 +47,29 @@ git pull origin main ``` Resolve the merge conflicts locally if any. + +8. **Commit again if there was any merge conflict** + + ```bash + git add + git status + git commit -m "Describe about the changes" + ``` -8. **Push your changes** +9. **Push your changes** Now push your changes to the remote repository. ``` git push origin feature/YourFeatureName ``` -9. **Create a Pull Request** +10. **Create a Pull Request** Go to the original repository on GitHub, click on the "Pull Request" tab, and submit your pull request. Include a detailed description of the changes you made and` why they should be merged. While making a PR, follow [Pull_request_template.md](Pull_request_template.md) to get your pull request accepted. -10. **Reporting Issues** +11. **Reporting Issues** If you find a bug or want to suggest a feature: From 17e69d2e20140e0bcbffc62ab7ef1b0e8f625a01 Mon Sep 17 00:00:00 2001 From: RohitP2005 Date: Sat, 14 Dec 2024 13:53:28 +0530 Subject: [PATCH 4/6] home button added --- frontend/src/components/Navbar.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Navbar.jsx b/frontend/src/components/Navbar.jsx index a888015..33cd666 100644 --- a/frontend/src/components/Navbar.jsx +++ b/frontend/src/components/Navbar.jsx @@ -105,7 +105,10 @@ export default function Navbar() { return (