2026-01-18 21:01:46 +01:00

17 lines
564 B
JavaScript

const z = require("zod")
module.exports = {
POST: {
headers: z.object({
"content-type": z.string().regex(/application\/json/i),
}),
body: z.object({
username: z.string()
.min(1),
password: z.string()
.min(8, { message: "The password must be at least 8 characters long." })
.regex(/[A-Z]/, { message: "The password must contain a capital letter." })
.regex(/[0-9]/, { message: "The password must contain a number." })
})
}
}