mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 09:23:48 +01:00
Fix bug
This commit is contained in:
parent
24cfde31ab
commit
88e11c7b0c
@ -100,7 +100,7 @@ export function validatePassword(password: string): boolean {
|
||||
}
|
||||
|
||||
export function isValidName(name: string): boolean {
|
||||
return typeof name == 'string' && name.length < 30 && name.trim() != '';
|
||||
return name === null || (typeof name == 'string' && name.length < 30 && name.trim() != '');
|
||||
}
|
||||
|
||||
export function isValidDescription(description: string): boolean {
|
||||
|
@ -24,7 +24,7 @@ export default async (value, verifier?: string) => {
|
||||
object.type !== 'Person' ||
|
||||
typeof object.preferredUsername !== 'string' ||
|
||||
!validateUsername(object.preferredUsername) ||
|
||||
(object.name != '' && !isValidName(object.name)) ||
|
||||
!isValidName(object.name == '' ? null : object.name) ||
|
||||
!isValidDescription(object.summary)
|
||||
) {
|
||||
throw new Error('invalid person');
|
||||
|
Loading…
Reference in New Issue
Block a user