add check for bio
This commit is contained in:
parent
9307319693
commit
e167dd79d7
1 changed files with 4 additions and 0 deletions
|
|
@ -28,6 +28,10 @@ async function validateInputs(name: string, bio: string, username: string, avata
|
||||||
throw error(400, 'Username contains inappropriate content');
|
throw error(400, 'Username contains inappropriate content');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bio && !(await isNameAppropriate(bio))) {
|
||||||
|
throw error(400, 'Bio contains inappropriate content');
|
||||||
|
}
|
||||||
|
|
||||||
if (avatarFile && avatarFile.size > MAX_FILE_SIZE) {
|
if (avatarFile && avatarFile.size > MAX_FILE_SIZE) {
|
||||||
throw error(400, 'Avatar file must be smaller than 1MB');
|
throw error(400, 'Avatar file must be smaller than 1MB');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue