Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
mudeer-web
/
src
/
app
/
validators
/
Filename :
PasswordValidator.ts
back
Copy
import { z } from 'zod' export const PasswordValidator = z.object({ current_password: z .string() .min(1, 'Current password is required'), password: z .string() .min(1, 'New password is required') .min(6, 'Password must be at least 6 characters long') .regex(/\d/, 'Password must contain at least one number'), confirm_password: z .string() .min(1, 'Please confirm your password'), }).refine((data) => data.password === data.confirm_password, { message: "Passwords do not match", path: ["confirm_password"], }) /** For superadmin resetting another user's password (no current password). */ export const SuperAdminPasswordValidator = z.object({ password: z .string() .min(1, 'New password is required') .min(6, 'Password must be at least 6 characters long') .regex(/\d/, 'Password must contain at least one number'), confirm_password: z .string() .min(1, 'Please confirm your password'), }).refine((data) => data.password === data.confirm_password, { message: "Passwords do not match", path: ["confirm_password"], })