Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

minor fix

daniel31x13e071b9eb07e2
diff --git a/lib/shared/schemaValidation.ts b/lib/shared/schemaValidation.ts
index ee105abf..ca6281ec 100644
--- a/lib/shared/schemaValidation.ts
+++ b/lib/shared/schemaValidation.ts
@@ -38,13 +38,15 @@ export const PostUserSchema = () => {
email: emailEnabled
? z.string().trim().email().toLowerCase()
: z.string().optional(),
- username: z
- .string()
- .trim()
- .toLowerCase()
- .min(3)
- .max(50)
- .regex(/^[a-z0-9_-]{3,50}$/),
+ username: emailEnabled
+ ? z.string().optional()
+ : z
+ .string()
+ .trim()
+ .toLowerCase()
+ .min(3)
+ .max(50)
+ .regex(/^[a-z0-9_-]{3,50}$/),
});
};