- Password minimum increased from 8 to 12 characters - CORS configurable via CORS_ORIGINS env var (comma-separated whitelist) - Pagination empty string q param handled via preprocess - Request timeout set to 30 seconds - Log file output via LOG_FILE env var (stdout + file in production) - Pino-pretty in development, JSON to stdout + file in production
20 lines
608 B
TypeScript
20 lines
608 B
TypeScript
import { z } from 'zod'
|
|
|
|
export const UserRole = z.enum(['admin', 'manager', 'staff', 'technician', 'instructor'])
|
|
export type UserRole = z.infer<typeof UserRole>
|
|
|
|
export const RegisterSchema = z.object({
|
|
email: z.string().email(),
|
|
password: z.string().min(12).max(128),
|
|
firstName: z.string().min(1).max(100),
|
|
lastName: z.string().min(1).max(100),
|
|
role: UserRole.default('staff'),
|
|
})
|
|
export type RegisterInput = z.infer<typeof RegisterSchema>
|
|
|
|
export const LoginSchema = z.object({
|
|
email: z.string().email(),
|
|
password: z.string().min(1),
|
|
})
|
|
export type LoginInput = z.infer<typeof LoginSchema>
|