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

[MM-246] Corregir errores detectados por lgtm #177

Merged
merged 1 commit into from Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions services/UserService.js
Expand Up @@ -162,9 +162,8 @@ module.exports.edit = async function edit(id, name, password, profileId) {
if (!password) throw missingPassword;
if (!profileId) throw missingProfileId;
try {
const passwordValidation = password && (Constants.COMMON_PASSWORDS.includes(password) || password.length < Constants.PASSWORD_MIN_LENGTH);

if (passwordValidation) throw Messages.VALIDATION.COMMON_PASSWORD;
if (Constants.COMMON_PASSWORDS.includes(password)) throw Messages.VALIDATION.COMMON_PASSWORD;
if (password.length < Constants.PASSWORD_MIN_LENGTH) throw Messages.VALIDATION.LENGTH_INVALID('password', 5);

const profile = await Profile.getById(profileId);
if (!profile) return Promise.reject(Messages.PROFILE.ERR.GET);
Expand Down