registerSchema (schemas/user.schema.ts)

WealthWise-Finance-Tracker · packages/shared-types/src/schemas/user.schema.ts · typescript · MIT
auth, tag:embed-classified

Defines Zod schemas for user registration, login, and profile operations.

// Source: https://github.com/hoangsonww/WealthWise-Finance-Tracker | License: MIT | Copyright 2026 Son Nguyen
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from "zod";

/**
 * Schema for user registration.
 * Enforces strong password policy: minimum 8 characters with at least
 * one uppercase letter, one lowercase letter, and one digit.
 */
export const registerSchema = z.object({
  email: z.string().trim().toLowerCase().email("Please provide a valid email address"),
  name: z
    .string()
    .trim()
    .min(2, "Name must be at least 2 characters")
    .max(50, "Name must be at most 50 characters"),
  password: z
    .string()
    .min(8, "Password must be at least 8 characters")
    .regex(/[A-Z]/, "Password must contain at least one uppercase letter")


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key