2026-08-19 16:29:17 +05:30
|
|
|
import { z } from 'zod';
|
|
|
|
|
|
2026-09-07 12:45:37 +05:30
|
|
|
export const loginSchema = z
|
|
|
|
|
.object({
|
|
|
|
|
email: z.string().email(),
|
|
|
|
|
password: z.string().min(1),
|
|
|
|
|
})
|
|
|
|
|
.strict();
|
|
|
|
|
|
|
|
|
|
export type LoginBody = z.infer<typeof loginSchema>;
|
2026-09-07 21:22:49 +05:30
|
|
|
|
|
|
|
|
/** 013-auth-hardening */
|
|
|
|
|
export const requestPasswordResetSchema = z
|
|
|
|
|
.object({
|
|
|
|
|
email: z.string().email(),
|
|
|
|
|
})
|
|
|
|
|
.strict();
|
|
|
|
|
|
|
|
|
|
export type RequestPasswordResetBody = z.infer<typeof requestPasswordResetSchema>;
|
|
|
|
|
|
|
|
|
|
export const resetPasswordSchema = z
|
|
|
|
|
.object({
|
|
|
|
|
token: z.string().min(1),
|
|
|
|
|
newPassword: z.string().min(1),
|
|
|
|
|
})
|
|
|
|
|
.strict();
|
|
|
|
|
|
|
|
|
|
export type ResetPasswordBody = z.infer<typeof resetPasswordSchema>;
|