@@ -1,3 +1,5 @@
|
||||
const zxcvbn = require('zxcvbn');
|
||||
|
||||
const Errors = {
|
||||
EMAIL_ALREADY_IN_USE: {
|
||||
emailAlreadyInUse: 'Email already in use',
|
||||
@@ -16,8 +18,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,
|
||||
},
|
||||
name: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
13
server/package-lock.json
generated
13
server/package-lock.json
generated
@@ -24,7 +24,8 @@
|
||||
"stream-to-array": "^2.3.0",
|
||||
"uuid": "^8.3.2",
|
||||
"validator": "^13.7.0",
|
||||
"winston": "^3.8.1"
|
||||
"winston": "^3.8.1",
|
||||
"zxcvbn": "^4.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.6",
|
||||
@@ -7984,6 +7985,11 @@
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/zxcvbn": {
|
||||
"version": "4.4.2",
|
||||
"resolved": "https://registry.npmjs.org/zxcvbn/-/zxcvbn-4.4.2.tgz",
|
||||
"integrity": "sha512-Bq0B+ixT/DMyG8kgX2xWcI5jUvCwqrMxSFam7m0lAf78nf04hv6lNCsyLYdyYTrCVMqNDY/206K7eExYCeSyUQ=="
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -14244,6 +14250,11 @@
|
||||
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
|
||||
"dev": true
|
||||
},
|
||||
"zxcvbn": {
|
||||
"version": "4.4.2",
|
||||
"resolved": "https://registry.npmjs.org/zxcvbn/-/zxcvbn-4.4.2.tgz",
|
||||
"integrity": "sha512-Bq0B+ixT/DMyG8kgX2xWcI5jUvCwqrMxSFam7m0lAf78nf04hv6lNCsyLYdyYTrCVMqNDY/206K7eExYCeSyUQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
"stream-to-array": "^2.3.0",
|
||||
"uuid": "^8.3.2",
|
||||
"validator": "^13.7.0",
|
||||
"winston": "^3.8.1"
|
||||
"winston": "^3.8.1",
|
||||
"zxcvbn": "^4.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.6",
|
||||
|
||||
Reference in New Issue
Block a user