1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-21 22:29:42 +02:00

fix: Use password strength estimator

Closes #294
This commit is contained in:
Maksim Eltyshev 2022-09-03 22:47:06 +05:00
parent 543a992d98
commit 3df07c10fa
14 changed files with 134 additions and 65 deletions

View file

@ -1,4 +1,5 @@
const bcrypt = require('bcrypt');
const zxcvbn = require('zxcvbn');
const Errors = {
USER_NOT_FOUND: {
@ -18,8 +19,7 @@ module.exports = {
},
password: {
type: 'string',
minLength: 6,
regex: /^(?=.*[A-Za-z])(?=.*\d).+$/,
custom: (value) => zxcvbn(value).score >= 2, // TODO: move to config
required: true,
},
currentPassword: {