Files
pwa/backend/src/modules/auth/auth.schemas.ts
T
ar.badieiandCursor 370ac15471 Ship Novya PWA with backend for deployable production use.
Fix production TypeScript builds and add DEPLOY.md so the app can be hosted from this repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 21:01:52 +03:30

28 lines
685 B
TypeScript

import { z } from 'zod';
export const emailSchema = z
.string()
.trim()
.min(1, 'Email is required')
.email('Invalid email')
.max(191)
.transform((value) => value.toLowerCase());
export const passwordSchema = z
.string()
.min(8, 'Password must be at least 8 characters')
.max(128, 'Password must be at most 128 characters');
export const registerSchema = z.object({
email: emailSchema,
password: passwordSchema,
});
export const loginSchema = z.object({
email: emailSchema,
password: z.string().min(1, 'Password is required').max(128),
});
export type RegisterInput = z.infer<typeof registerSchema>;
export type LoginInput = z.infer<typeof loginSchema>;