Files
goGin/frontend/lib/auth-schema.ts
Beyhan Oğur 2a5b661443 first commit
2026-04-26 21:46:42 +03:00

22 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { z } from "zod";
export const loginSchema = z.object({
email: z.string().email({ message: "Geçerli bir e-posta adresi giriniz." }),
password: z.string().min(6, { message: "Şifre en az 6 karakter olmalıdır." }),
// Turnstile token is optional in schema but required for submission logic if enabled
turnstileToken: z.string().optional(),
});
export const registerSchema = z.object({
username: z.string().min(3, { message: "Kullanıcı adı en az 3 karakter olmalıdır." }),
email: z.string().email({ message: "Geçerli bir e-posta adresi giriniz." }),
password: z.string().min(8, { message: "Şifre en az 8 karakter olmalıdır." }),
confirmPassword: z.string().min(8, { message: "Şifre tekrarı en az 8 karakter olmalıdır." }),
}).refine((data) => data.password === data.confirmPassword, {
message: "Şifreler eşleşmiyor.",
path: ["confirmPassword"],
});
export type LoginInput = z.infer<typeof loginSchema>;
export type RegisterInput = z.infer<typeof registerSchema>;