Skip to content

Commit

Permalink
Merge pull request #37 from GSG-G8/27-Validation
Browse files Browse the repository at this point in the history
27 validation
  • Loading branch information
Mu7ammadAbed authored Mar 4, 2020
2 parents 910bd2c + 7a7f6d5 commit 9ded714
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2 class="login__title">Log in to PalB</h2>
<form class="login__form" action="/login" method="post">
<input
type="email"
class="login__form__input"
class="form__input"
name="email"
aria-label="user email"
placeholder="Email"
Expand Down Expand Up @@ -55,7 +55,7 @@ <h3 class="signup__title">Register | PALB</h3>
/>
<input
type="password"
class="signup__form__input"
class="form__input"
name="confirm"
aria-label="user repassword"
placeholder="Confirm password"
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const getPost = (req, res, next) => getPosts().then((data) => {
const getUsers = (req, res, next) => {
const schema = Joi.object().keys({
email: Joi.string().email().required(),
password: Joi.string().regex(/^[0-9]{3,}$/).required(),
password: Joi.string().regex(/(?=.*[a-z])(?=.*[A-Z])(?=.*\d)^\w{6,}$/).required(),
});
const { error, value } = schema.validate(req.body);
if (error) {
Expand Down

0 comments on commit 9ded714

Please sign in to comment.