make username lowercase

This commit is contained in:
miloschwartz 2025-06-19 15:41:49 -04:00
parent 58ba0d07b0
commit 1bf2e23f5d
No known key found for this signature in database
8 changed files with 18 additions and 15 deletions

View file

@ -21,6 +21,7 @@ const bodySchema = z
.object({
email: z
.string()
.toLowerCase()
.optional()
.refine((data) => {
if (data) {
@ -28,7 +29,7 @@ const bodySchema = z
}
return true;
}),
username: z.string().nonempty(),
username: z.string().nonempty().toLowerCase(),
name: z.string().optional(),
type: z.enum(["internal", "oidc"]).optional(),
idpId: z.number().optional(),