User: enforce {1,30} character limit on username
This commit is contained in:
parent
c93aa5b314
commit
7808565d71
|
@ -4,7 +4,7 @@ const kv = await Deno.openKv();
|
||||||
|
|
||||||
const userSchema = z.object({
|
const userSchema = z.object({
|
||||||
pubkey: z.string().regex(/^[0-9a-f]{64}$/).describe('primary'),
|
pubkey: z.string().regex(/^[0-9a-f]{64}$/).describe('primary'),
|
||||||
username: z.string().regex(/^[\w_]+$/).describe('unique'),
|
username: z.string().regex(/^[\w_]{1,30}$/).describe('unique'),
|
||||||
createdAt: z.date(),
|
createdAt: z.date(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue