Dev #13

Merged
ImanThiyanga merged 18 commits from Dev into production 2026-07-22 06:12:34 +00:00
2 changed files with 11 additions and 12 deletions
Showing only changes of commit fe9e8a780f - Show all commits
+7
View File
@@ -29,3 +29,10 @@ yarn-error.log*
.DS_Store
Thumbs.db
.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/
+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>