ui updated
This commit is contained in:
@@ -29,3 +29,10 @@ yarn-error.log*
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
|
# ── Migrations ─────────────────────────────────────────────────────────
|
||||||
|
# New EF Core migrations are not committed. Note the 4 migrations already in
|
||||||
|
# Backend/ERPCore/Infra/Persistence/Migrations/ stay tracked — .gitignore does
|
||||||
|
# not apply to tracked files — so edits to those still get committed as normal.
|
||||||
|
# Untracking them too takes `git rm --cached`.
|
||||||
|
**/Migrations/
|
||||||
|
|||||||
@@ -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
|
// Login schema (email + password) for reuse across the app
|
||||||
export const loginSchema = z.object({
|
export const loginSchema = z.object({
|
||||||
email: emailSchema,
|
email: emailSchema,
|
||||||
password: requiredString("Password is required")
|
// Login only checks that a password was typed — complexity rules belong to
|
||||||
.refine((val) => val.length >= 8, { message: "Password must be at least 8 characters" })
|
// signup/reset. Enforcing them here just leaks the policy and blocks users
|
||||||
.refine((val) => /[A-Z]/.test(val), {
|
// whose existing password predates it; the server decides what's valid.
|
||||||
message: "Password must contain at least one uppercase letter",
|
password: requiredString("Password is required"),
|
||||||
})
|
|
||||||
.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",
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export type LoginValues = z.infer<typeof loginSchema>
|
export type LoginValues = z.infer<typeof loginSchema>
|
||||||
|
|||||||
Reference in New Issue
Block a user