mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-25 22:36:38 +00:00
make username lowercase
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -30,8 +30,8 @@ const inviteUserBodySchema = z
|
||||
.object({
|
||||
email: z
|
||||
.string()
|
||||
.email()
|
||||
.transform((v) => v.toLowerCase()),
|
||||
.toLowerCase()
|
||||
.email(),
|
||||
roleId: z.number(),
|
||||
validHours: z.number().gt(0).lte(168),
|
||||
sendEmail: z.boolean().optional(),
|
||||
|
||||
Reference in New Issue
Block a user