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
+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';
}