Skip to content

Commit

Permalink
Merge pull request #97 from gnmyt/updates/password-policy
Browse files Browse the repository at this point in the history
🔑 Remove required password pattern
  • Loading branch information
gnmyt authored Sep 14, 2024
2 parents 6994f08 + cf937f0 commit 793a2a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 0 additions & 5 deletions client/src/common/components/LoginDialog/LoginDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ export const LoginDialog = ({ open }) => {

return true;
} catch (error) {
if (error.message.toString().includes("^(?=.*[0-9])")) {
setError("Password must contain at least one number and one special character");
return false;
}

setError(error.message || "An error occurred");
return false;
}
Expand Down
6 changes: 2 additions & 4 deletions server/validations/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const Joi = require('joi');

module.exports.registerValidation = Joi.object({
username: Joi.string().min(3).max(15).alphanum().required(),
password: Joi.string().min(5).max(150).required()
.pattern(new RegExp('^(?=.*[0-9])(?=.*[^a-zA-Z0-9])')),
password: Joi.string().min(3).max(150).required(),
firstName: Joi.string().min(2).max(50).required(),
lastName: Joi.string().min(2).max(50).required(),
});
Expand All @@ -13,8 +12,7 @@ module.exports.totpSetup = Joi.object({
});

module.exports.passwordChangeValidation = Joi.object({
password: Joi.string().min(5).max(150).required()
.pattern(new RegExp('^(?=.*[0-9])(?=.*[^a-zA-Z0-9])')),
password: Joi.string().min(3).max(150).required(),
});

module.exports.updateNameValidation = Joi.object({
Expand Down

0 comments on commit 793a2a9

Please sign in to comment.