ui updated

This commit is contained in:
2026-07-20 12:00:03 +05:30
parent 92c4b14a6c
commit fe9e8a780f
2 changed files with 11 additions and 12 deletions
+4 -12
View File
@@ -15,18 +15,10 @@ export const emailSchema = z.string().min(1, "Email is required").email("Enter a
// Login schema (email + password) for reuse across the app
export const loginSchema = z.object({
email: emailSchema,
password: requiredString("Password is required")
.refine((val) => val.length >= 8, { message: "Password must be at least 8 characters" })
.refine((val) => /[A-Z]/.test(val), {
message: "Password must contain at least one uppercase letter",
})
.refine((val) => /[a-z]/.test(val), {
message: "Password must contain at least one lowercase letter",
})
.refine((val) => /[0-9]/.test(val), { message: "Password must contain at least one number" })
.refine((val) => /[!@#$%^&*(),.?":{}|<>\[\]\\/`~;'+=-]/.test(val), {
message: "Password must contain at least one special character",
}),
// Login only checks that a password was typed — complexity rules belong to
// signup/reset. Enforcing them here just leaks the policy and blocks users
// whose existing password predates it; the server decides what's valid.
password: requiredString("Password is required"),
})
export type LoginValues = z.infer<typeof loginSchema>