better error handling register

This commit is contained in:
Janis M
2022-03-29 14:38:40 +02:00
parent 5c128cb2ae
commit 283d2fe66f
16 changed files with 367 additions and 260 deletions

15
validators.js Normal file
View File

@@ -0,0 +1,15 @@
function validate_password(password) {
var re = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$/;
if(re.test(password)){
if(password.length > 8 && password.length < 255){
return true
}
}
return false;
}
module.exports = {
validate_password
}