Added a typecheck to password field

This commit is contained in:
2023-05-15 08:03:16 +10:00
parent 3a8cfd39ed
commit 267ecaa705
3 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "auth-server",
"version": "1.7.2",
"version": "1.7.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "auth-server",
"version": "1.7.2",
"version": "1.7.4",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "auth-server",
"version": "1.7.3",
"version": "1.7.4",
"description": "An API centric auth server. Uses Sequelize and mariaDB by default.",
"main": "server/server.js",
"scripts": {
+4
View File
@@ -83,6 +83,10 @@ const validateDetails = async (body) => {
return 'Missing password';
}
if (typeof body.password != "string") {
return 'Invalid password';
}
if (body.password.length < 8) {
return 'Password too short';
}