Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password validation feature #6

Open
wants to merge 2 commits into
base: 3-add-password-requirements-in-register-page
Choose a base branch
from

Conversation

Silent-Watcher
Copy link

Add password validation in the back-end based on the given requirements

this will resolve issue #3

Let me know your thoughts or share any additional requests—your input helps me improve! 😀

Copy link

vercel bot commented Dec 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
task-management-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2024 6:25am
task-management-org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2024 6:25am

Copy link

vercel bot commented Dec 8, 2024

@Silent-Watcher is attempting to deploy a commit to the Akash Deep's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Owner

@akashdeep023 akashdeep023 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update code based on review @Silent-Watcher

@@ -8,6 +8,12 @@ const registerUser = async (req, res, next) => {
if (existingUser) {
return res.status(400).json({ message: `User Already Exist` });
}

const validationResult = registerSchema.validate({password});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Require registerSchema
const { registerSchema } = require("../validation/auth.validation");

@@ -2,8 +2,9 @@ const express = require("express");
const router = express.Router();
const authControllers = require("../controllers/auth");
const wrapAsync = require("../middlewares/wrapAsync");
const { registerSchema } = require("../validation/auth.validation");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all changes.

@akashdeep023
Copy link
Owner

akashdeep023 commented Dec 8, 2024

And also apply it to the register page in frontend side.

UI

Password must be at least 8 characters and contain 1 number, 1 uppercase
letter
, 1 lowercase letter, and 1 symbol.

If the password contains 1 number then the color of the 1 number will turn green.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants